Not getting enough vitamin D has been linked to a wide variety of health problems, including obesity, diabetes, heart disease, and certain types of cancer.  Now, research suggests that low levels may also increase the risk for chronic headaches.

The new Finnish study found that men with the lowest levels of vitamin D were more than twice as likely to have headaches at least once a week, compared to those with the highest levels. Chronic headaches were also more frequently reported by men who were examined from October through May, when vitamin D levels in Finland tend to be lower.

Not all of the men with lower-than-recommended vitamin D levels had regular head pain; of the 2,601 men included in the study, 68% had levels below 50 nanomoles per liter (nmol/L), the threshold for deficiency. (Because Finland is far from the equator—and because skin must be exposed to sunlight in order for the body to produce vitamin D on its own—low levels are common through much of the year.) Chronic headaches were only reported by 9.6% of the men. But those men, on average, had lower levels (38.3 nmol/L) than those without headaches (43.9 nmol/L). The results were adjusted for participants’ age and for the time of year samples were taken.

RELATED: 27 Health Problems Linked to Low Vitamin D

The research, which was published in the journal Scientific Records, could only establish an association between the two health conditions, not a cause-and-effect relationship. But several smaller studies have made similar connections between headaches and low vitamin D. “Our study, being one of the largest studies that have investigated the issue, supports the view that vitamin D may be beneficial in headache prevention,” the authors wrote.

The researchers aren’t sure why, exactly, the so-called sunshine vitamin might help ward of head pain, but they suggest it may be protective against inflammation or nerve-related pain.  

Christine Gerbstadt, MD, author of Doctor’s Detox Diet, says that while no perfect study has been conducted on this topic, a trend has clearly emerged showing that people (or adult men, at least) with healthy vitamin D levels have a lower incidence of chronic headaches.

RELATED: 11 Surprising Migraine Triggers

“The bonus in treating low serum vitamin D is improvement in the many other important health functions of the vitamin,” says Dr. Gerbstadt, who was not involved in the new research. Restoring vitamin D to normal levels—through food or supplements—is already a good idea, she adds, but this study suggests that it may have the added benefit of relieving head pain in those who suffer from it. 

Even though the United States isn’t as far north as Finland, it can still be difficult for Americans to make enough vitamin D through sunlight exposure in the winter months. Luckily, the nutrient can also be found in eggs, fatty fish, and fortified foods like milk and cereal. What you pair those foods with matters, too: “Vitamin D is best absorbed when eaten with food containing fat—such as low-fat yogurt, olive oil dressing, or avocado,” says Dr. Gerbstadt, who is also a registered dietitian.

The jury is still out on the benefits, or the potential risks, of taking vitamin D supplements for people who already have normal levels. But for those diagnosed with a deficiency, the case for supplementation is much clearer. This group may need large replacement doses for about six weeks, Dr. Gerbstadt says, followed by a daily supplement of 50 to 2,000 IUs.

Whether physicians should routinely test for vitamin D levels has been a controversial topic, and it’s not currently recommended by the U.S. Preventive Services Task Force unless a patient has signs of a deficiency. But if you’re concerned about your levels—especially through the winter months—ask your doctor about whether you should get checked. “Measuring your serum D is a simple, inexpensive blood test, which can be added to other lab testing with regular physical exams,” Dr. Gerbstadt says.