Magnesium is an important intracellular element that is involved in numerous cellular functions. Deficiencies in magnesium may play an important role in the pathogenesis of migraine headaches by promoting cortical spreading depression, alteration of neurotransmitter release and the hyperaggregation of platelets. Given this multifaceted role of magnesium in migraine, the use of magnesium in both acute and preventive headache treatment has been researched as a potentially simple, inexpensive, safe and well-tolerated option. Studies have shown that preventive treatment with oral magnesium and acute headache treatment with intravenous magnesium may be effective, particularly in certain subsets of patients. In this review, the pathogenesis of migraine will be discussed, with an emphasis on the role of magnesium. Studies on the use of intravenous and oral magnesium in migraine treatment will be discussed and recommendations will be made regarding the use of magnesium in treating migraine headaches.