If you do a quick search (I use Dogpile instead of google) you'll find answers like this :
If you live in a humid area of the country, you’ve probably seen unsightly dark streaks on asphalt shingle roofs. Though often attributed to an accumulation of dirt, defective shingles, mold, or mildew; the most common culprit is actually a blue-green algae known as Gloeocapsa Magma that is spread by airborne spores.
Prevention
To keep algae from coming back once your roof is clean, install a strip of copper or zinc coated sheet metal along each side of the roof just below the ridge. To be effective, 2" to 4" of metal should be visible on the roof.
While copper is more toxic to algae, galvanized sheet metal is much less expensive. Both copper and galvanized metal are available in rolls of various widths and thickness both online and from local metal suppliers. You can also purchase zinc strips specifically made to eliminate roof algae from
Z-Stop.
Narrow strips of sheet metal can be attached directly to your roof using roofing nails or screws with a rubber washer. For wider pieces of sheet metal, loosen the self-sealing tabs on the top row of shingles with a putty knife, slip part of the sheet metal under them, and nail it in place under the shingles with roofing nails.
The methods used to eliminate and prevent algae on your roof can also be applied to moss