Lighting can trigger the onset of painful headaches, particularly in people who suffer migraines, according to a new study.

The latest study published in the journal Cephalagia is the first to link lightning to headache, and could possibly help chronic headache sufferers predict attacks and using weather forecasts.

Researchers from the University of Cincinnati had participants who regularly suffered migraines record daily headache activity for between three and six months. Researchers also recorded the location where the lightning occurred in relation to their homes and the magnitude of the lightning's current.

The study revealed that there was a 31 percent increased risk of headache and 28 percent increased risk of migraine for people who suffer chronic headache on days lightning struck within 25 miles of the study participants' homes.

Furthermore researchers found that new-onset headache and migraine increased by 24 percent and 23 percent in participants.

"We used mathematical models to determine if the lightning itself was the cause of the increased frequency of headaches or whether it could be attributed to other weather factors encountered with thunderstorms," lead researcher Professor Vincent Martin of the University of Cincinnati said in a statement. "Our results found a 19 percent increased risk for headaches on lightning days, even after accounting for these weather factors."

"This suggests that lightning has its own unique effect on headache," he explained.

Professor Martin explained that there are many ways in which lightning might trigger headaches.

"Electromagnetic waves emitted from lightning could trigger headaches. In addition, lightning produces increases in air pollutants like ozone and can cause release of fungal spores that might lead to migraine," he explained.

His son Geoffrey, a fourth year medical student who also worked on the research, said that many previous studies have shown conflicting findings on how weather, like barometric pressure and humidity, affect the onset of headaches.

However, he said that the latest study "very clearly" shows a correlation between lightning, associated meteorological factors and headaches.

"This study gives some insight into the tie between headaches or migraines, lightning and other meteorologic factors," Geoffrey added. "However, the exact mechanisms through which lightning and/or its associated meteorologic factors trigger headache are unknown, although we do have speculations."

"Ultimately, the effect of weather on headache is complex, and future studies will be needed to define more precisely the role of lightning and thunderstorms on headache," he said.