It's the light. Light, heat and moisture causes algae. I find having a lid where the light sits NOT on the glass, but has a large spot where the light does not have to go through the glass (cut out section) works best to avoid algae.
Algae is not a terrible evil force to be reckoned with. It's... Algae. Now, black beard and hair algae... Not good!! But regular green/brown algae or gooey algae is pretty common and harmless. It won't bug your fishies, just probably you aesthetically. Now my 30 HAS had so much algae that three days later I could not see a fish in sight (literally every wall was coated with the algae) and I resorted to a Siamese (4 inch) Algae Eater - not to be confused with the larger, more aggressive Chinese Algae Eater - and in a day he was fat and my tank was sparkling clean!
Depending on what size of tank you have, and what you have in there (betta, community fish, etc) there are some helpful buddies you could get... Otherwise you may want to cut out a section of the glass so the light shines in the tank, rather than through the glass. Or you are stuck with hand-to-algae battles :)