In one example from 1727, a man from New England reported how he felt the ground shake then saw a ball of light roll onto his dog, causing the animal to yelp.

In Peru in 2009, a fisherman said he saw the sky turn violet before the earthquake, while in L'Aquila in 2009, a man saw white flashes before the tremor struck, the International Business Times reported.

Researchers writing in the publication Seismological Research Letters have now put forward a theory about this mystery glowing, which takes place in geological rifts when the ground is being torn apart.

The authors looked at several studies about earthquake lights to propose a mechanism for why they occur, Nature magazine reports.

They compiled all the reports of earthquake lights from 1600 to date, focusing on 27 earthquakes in the US and 38 in Europe.

Of the 65 studied, 56 earthquakes occurred along ancient or active rift zones. A further 63 took place where geological faults that ruptured were almost vertical – many fault lines have much smaller angles.

Lead author Robert Thériault, a geologist at Quebec's Ministry of Natural Resources in Quebec City, said: "Earthquake lights are a real phenomenon – they're not UFOs. They can be scientifically explained."

John Ebel, a geophysicist at Boston College in Massachusetts, explained why there have been problems studying this phenomenon in the past: "It's just not a regular area of scientific inquiry, because there's no way to do an experiment on them."

In the study, the authors say that during an earthquake, the rocks grinding against each other generate electric charges that travel up along the fault lines. When they reach Earth's surface, they create a glow.

They believe the steep geometry explains the earthquake lights. Team member Friedemann Freund, a mineral physicist at the NASA Ames Research Center in California, believes a chemical process causes the lights.

"When the stress of an earthquake hits the rock, it breaks chemical bonds involved in these defects, creating holes of positive electrical charge," Nature reports. "These 'p holes' flow can vertically through the fault to the surface, triggering strong local electric fields that can generate light."

However, Ebel said there are a number of other reactions that may be responsible for these mystery lights: "It makes enough sense, but that doesn't mean that it's right."

Thériault added that while they have not yet got a definitive answer about the lights, awareness of their presence could help as a warning sign for earthquakes.