Whales who get stranded could be led off course by changes in Earth's magnetic field caused by the sun.
Experts examined the conditions of whales stranded between the years 1712 and 2003 and found more were stranded when solar activity is high.
They reckon whales use the Earth's magnetic field to find their way to places, a bit like homing pigeons do.
This means if the sun changes the magnetic fields, whales can become confused and land on beaches.
The number of whales, dolphins and porpoise who have stranded themselves around the UK has doubled over the last 10 years.
Some animal campaigners claim increased noise from ships' engines and sonar could also be making the marine animals lose their way.