Migraines are vascular headaches. The blood vessels in your head first constrict, then dilate. The constiction causes the 'aura' or warning signs some people get when they're first getting a headache, and the subsequent dilation causes the pain. Most of the prescription migraine meds affect those blood vessels, that's why you're supposed to take when as soon as you feel a headache coming. Caffiene also affects, as Karma said, blood flow, and I find it helps sometimes. Most of the time, if I can catch it early, I can fend it off. If I don't get it at the start I start puking, and then have to go get a shot of anti-nausea meds and more often than not a narcotic. Then I'll sleep for a few hours and 9 times out of 10 wake up feeling better.
I find that lack of sleep, stress and hormonal fluctuations will all trigger migraines. I used to get them every couple of weeks, but now I'm on some low-dose hormone therapy they've spaced out a lot. I was also on amitiptyline (a tricyclic anti-depressant) as a prophylactic - it not only affects the serotonin levels and thereby can help reduce the frequency of migraines, but it also enhances the way pain medication works. It became less effective for me over time, so I quit taking it. Luckily the hormone therapy seems to be working quite well.
I grind my teeth when I'm awake, so I'm sure I do it in my sleep as well. perhaps I sould ask my doc about an occlusal guard...can't hurt to try, right?