There are many factors that can contribute to you having a headache; one of them is stress. Did you know that magnesium is natural stress reliever? Furthermore, serotonin (a neurotransmitter) is dependent on magnesium for its production and function. In theory, the lower your serotonin levels, the more adverse the effects of stress can be on you. A deficiency in serotonin can also lead to depression and migraine headaches. ‘Mg deficiency intensifies adverse reactions to stress that can be life threatening.’ 
‘Mg deficiency intensifies adverse reactions to stress that can be life threatening.’
a) Stress can induce tension in your muscles = tension headaches.
b) Magnesium relaxes the head and neck muscle tension.
c) Magnesium relaxes blood vessels, allowing them to dilate, thus reducing spasms and constrictions that can cause migraines.
d) Magnesium relaxes muscles and prevents the build-up of lactic acid; lactic acid in combination with tension can worsen head and muscle pain.
e) Magnesium regulates brain neurotransmitter action and inflammatory substances.
f) Magnesium prevents platelet aggregation (the clumping together of platelets in the blood), therefore preventing the formation of clots that can cause blood vessel spasm and the occurrence of migraine pains.
It has been suggested by a few clinical studies that ‘magnesium supplements may shorten the duration of a migraine and reduce the amount of medication needed.’ Individuals who have migraine headaches usually tend to have lower levels of magnesium in comparison to those with tension headaches or no headaches at all.
The importance of magnesium to the nervous system is such that your brain stores twice as much magnesium as other body tissues. Magnesium is an anti-stress mineral that has a calming effect, induces restful sleep and is very useful for the person with an overactive nervous system or who is anxious or agitated.
As a preventative measure, we recommend having regular foot soaks or baths using magnesium flakes, using magnesium oil or lotion daily, and increasing your intake of magnesium-rich foods.
In an acute situation, where you feel the onslaught of a migraine or have a headache, we suggest saturating your scalp with magnesium oil, apply magnesium oil on your forehead, temples, back of neck, shoulders and chest. Some users like to also add 5-10 drops of Mg Oil to a glass of warm water, drink that then rest/relax in a cool and dark room until you feel the migraine/headache ease off. Do as many of the above suggested as you can. We know headaches and migraines don't always come at convenient times. But in general for many, the more magnesium used in a shorter span of time, the faster the results.
If you have other recommendations, or have used magnesium for your headaches and migraines, please do share in a comment below!
 Carolyn Dean, M.D., N.D., ‘The Magnesium Miracle’, (New York: Ballantine Books, 2007) p.45
 Ibid., xx
 Mildred S. Seelig, (1994) Consequences of Magnesium Deficiency on the Enhancement of Stress Reactions; Preventive and Therapeutic Implications (A Review), Journal of the American College of Nutrition, 13 (5), pp. 429-446
 “Definition of platelet aggregation.” MedicineNet.com. 2004 , [accessed 06.01.2011] <http://www.medterms.com/script/main/art.asp?articlekey=33673 >
 “Magnesium.” University of Maryland Medical Center | Home. N.p., n.d. [accessed: 09.01.2011] <http://www.umm.edu/altmed/articles/magnesium-000313.htm>