dj1 is correct that bleach will kill moss, just as clorine controls green algae growth in swimming pools.

If the roof accumulation is such that it is a visible , usually along the lower edge of the shingles, it is best to physically remove it first. I have spent a couple hours up on my roof scaping the stuff off, then using my garden blower to blow it off the roof.

To keep it from returning, there are a couple solutions, both by the use of zinc. Powder containing zinc is available at homeowner stores under the name Moss Out. This is shaken up along the ridge line of the roof. During rain, the zinc leeches down the roof and kills moss. There are also strips of zinc which can be mounted along the ridge line, also leeching zinc down the roof. You do have to be a little careful as to where the run off goes, as zinc can also kill other green vegetation.

Here in Portland, Oregon, moss could be named the State Plant