In a Huffington Post blog (1) the author writes:
Think of magnesium as the relaxation mineral. Anything that is tight, irritable, crampy, and stiff — whether it is a body part or an even a mood — is a sign of magnesium deficiency.
This critical mineral is actually responsible for over 300 enzyme reactions and is found in all of your tissues — but mainly in your bones, muscles, and brain. You must have it for your cells to make energy, for many different chemical pumps to work, to stabilize membranes, and to help muscles relax.
Magnesium is used to treat many things including Complex Regional Pain Syndrome and Restless Leg Syndrome.(2)
Finally, in an article on DrOz.com the author, Jacob Teitelbaum, MD, discusses magnesium and its use to fight pain:
Clinical experience, as well as research in nerve pain conditions such as pancreatic cancer, has shown that magnesium can be an effective treatment for pain. Although it is clear why magnesium can decrease muscle pain (it makes muscles relax), why it would help nerve pain was less clear. A new study on rats to be printed in The Journal of Physiology confirms our clinical experience that magnesium decreases nerve pain — while also pointing to how it works.(3).
References: (1)http://www.huffingtonpost.com/dr-mark-hyman/magnesium-the-most-powerf_b_425499.html (2)http://www.webmd.com/vitamins-supplements/ingredientmono-998-magnesium.aspx?activeingredientid=998 (3)http://www.doctoroz.com/blog/jacob-teitelbaum-md/magnesium-pain-relief