A study found lightning striking up to 25 miles away can increase the risk of headache by 31%.
Thunderbolts also led to a 28% increased risk of migraine attacks.
US researchers looked at 90 chronic headache sufferers with an average age of 44 living in Ohio and Missouri.
All had conditions that fulfilled the criteria for migraines defined by the International Headache Society.
Participants recorded their headache experiences in a daily journal for three to six months.
During this time, scientists recorded lightning strikes within 25 miles of people's homes. The magnitude and polarity of the lightning current was also measured.
Geoffrey Martin, from the University of Cincinnati, who co-led the research, said: "Many studies show conflicting findings on how weather, including elements like barometric pressure and humidity, affect the onset of headaches. However, this study very clearly shows a correlation."
Mr Martin, a medical student, conducted the study with his father Vincent, a professor of internal medicine at the University of Cincinnati, and headache expert.
Mr Martin said: "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."