In reply to dhuhkosi:
yes - it's miserable.
I haven't really got an answer, except lots of ibuprofen and going to bed if you can. Sometimes a brisk walk in fresh air with loads of ibuprofen can help.
Fortunatley, I get them rarely these days, and even less so since we had an extension built on our house - my classic way of triggering them was buttering toast in the morning on a sunny day - the sunlight would reflect off the knife into my eyes and bingo. Now the toast buttering spot is not in sunlight!
I particularly dislike computer screesn with a bright window behind them and dark places with bright sunlight in the distance (some tunnels for example) and I'm always careful when I emerge into bright sunlight from somewhere dark or draw the curtains on a very sunny morning).
The main thing is to be aware - which is why the toast buttering thing caught me out so often - it was so mundane. Now for example, as few of the blinds at one end of the office are open: it's very sunny and a significant contrast to the light in the rest of the office - I'm studiously avoiding looking at it, even though it's directly in my line of sight. When I do, I'll look up slowly to let my eyes adjust to the brightness.
Other than that, I avoid orange juice like the plague - it was my trigger was I was a kid.