A link between migraine headaches and epilepsy has been known or suspected (depending on who's asked) for a long time. For the last century or so, a ketogenic diet has been used with a lot of success to treat epileptic patients. We'd like to know if that suggests anything about its efficacy in the treatment of migraines.
This would probably be a lot easier if we knew more about the causes and physiologies of epilepsy and migraines, but we should be able to get some hints from what we do know. For example, migraines seem to correspond with an unusually alkaline blood pH and to respond favorably to lowering it (making it more acidic). On a very-low-carb diet, the blood is very acidic because the ketone bodies themselves are acidic. This may account for the success of the diet in treating urinary tract infections.
Another place doctors are looking for the cause of migraines is GABA, an important neurotransmitter. Ketosis has significant effects on GABA metabolism, which is specifically targeted by lots of migraine and epilepsy medications with great success. Ketosis, in many important ways, mimics the effects of these drugs. Or to put it another way, the drugs mimic the effects of ketosis!
Another very important neurotransmitter is glutamate. It's also a chemical precursor to GABA, so there's a lot of interplay between the two in the brain. Impairments in the metabolism of either chemical, and in the conversion of glutamate to GABA, have been implicated in a number of neurological problems, including epilepsy and migraines. The ketogenic diet increases the rate of conversion of glutamate to GABA, which would tend to protect against these problems according to our current understanding of them. The article I'm going to use to back up these claims is positively dense with great information, and if you can handle scientific literature written for scientists you might want to check it out: The Neuropharmacology of the Ketogenic Diet.
All this is mostly theoretical, of course. A few rigorous studies that have been done to figure out if migraines can be effectively treated with a ketogenic diet, but unfortunately their full texts aren't freely available online. This one has some of the results available, and they're interesting enough that I almost want to purchase the article.
What I did find with little trouble is quite a bit of anecdotal evidence of people treating their own symptoms with the diet. Some tried the diet to lose weight and realized they stopped having migraines. Some of them remained migraine-free even after stopping the diet, which matches up with some of the published results. If any of you migraine sufferers feel like experimenting on yourselves, or if you already have, I would really love to hear about it.