Yep, sunglasses. I keep a pair on me at all times. Also hats and hoodies can be of help sometimes.
If none of those things are around, I've found that it helps looking directly towards the brightest light source with my eyes closed. It is awful to do it, kinda hurts, but once I look away and open my eyes again, the eyes have adjusted to the bright light, so everything around it is much less intense to look at.