While sunlight helps the grape to grow, once it is off the vine, any further exposure to sunlight accelerates its deterioration. In as little as 3 hours of direct sunlight exposure, a clear bottle of wine will have changed from wonderful to terrible. Interestingly enough, it is the Vitamin B2's and B5's in the wine reacting with the naturally present amino acids that causes the wine to alter its wonderful aromas into a malodorous mess.
WHITE, GREEN, BROWN
Green bottles apparently offer more protection, and just visually this makes sense. We can't see the wine inside clearly and experts estimate that green bottles offer six times more protection or 18 hours of direct UV exposure before the wine becomes unpalatable. Amazingly, brown bottles can apparently ward off all UV light and are therefore safe- except from the heat that sunlight can generate which will make it lose antioxidants, change its colour and cause other chemical reactions that you don't want.
So, in short, if you see that a store has placed its bottles of wine along glass walls where sunlight can clearly shine through OR that they are in an environment where there is clearly large fluctuations in temperature (towards the hotter side, i.e., exceeding 26°C), skip it or choose other things in the store.