Magnesium is the fourth most abundant mineral in the body. We need it to maintain muscle tissue, nerves, and bones. Magnesium also helps maintain normal blood pressure and metabolism. Beyond that, a magnesium-rich diet may help protect against metabolic syndrome, a combination of risk factors that can lead to obesity, type 2 diabetes, and heart disease.
Magnesium flakes are Epsom salts (magnesium sulfate), which have a laxative effect that works by drawing water into the colon. I wouldn't advise using them as a dietary supplement. As for magnesium oil, I've seen some over-the-top claims online: that it can help reverse the aging process, relieve arthritis pain, and rejuvenate aging skin. I know of no evidence to support those claims and do not recommend using magnesium oil as a supplement.
Because all forms of magnesium can act as laxatives, I suggest taking it with some calcium to balance its effects. The forms I prefer are magnesium citrate, chelate, or glycinate. Avoid magnesium oxide, which can be irritating to the digestive tract.
Good dietary sources of magnesium include whole grains, leafy green vegetables (spinach especially), as well as almonds, cashews and other nuts, avocados, beans, soybeans and fish, especially halibut. Be aware that a diet high in fat may interfere with absorption of magnesium and that cooking may decrease the magnesium content of food. I wouldn't worry about the phytates found in whole grains, legumes, nuts and seeds. While they can hinder absorption of some minerals, they are not a problem if you're eating a balanced diet. Most of us consume more than enough minerals to make up for those that may be bound by phytates.
If you want to boost your magnesium intake, I suggest taking one of the supplement forms I recommend rather than trying to get large amounts from food.
Andrew Weil, M.D.