Sunshine acts like an addictive drug and has a similar effect on the body as heroin, scientists claim.
Ultraviolet (UV) rays from the sun stimulate the production of endorphins, "feel good" hormones that act on the same biological pathway as opioid drugs, research shows.
The study suggests that the desire to bake for hours on a beach involves more than topping up a tan.
It may appease our craving for a sunshine "fix", in much the same way as an addict satisfies a yearning for heroin or morphine.
Lead scientist Dr David Fisher, from Harvard Medical School in the US, said: "This information might serve as a valuable means of educating people to curb excessive sun exposure in order to limit skin cancer risk as well as accelerated skin ageing that occurs with repeated sun exposure.
"Our findings suggest that the decision to protect our skin or the skin of our children may require more of a conscious effort rather than a passive preference."
Experts had known that sun-seeking behaviour can fit the clinical criteria for a substance-related disorder. But what underlay this apparent "addiction" had been unknown until now.
Dr Fisher and his team investigated links between UV exposure and the opioid receptor pathway in "naked" laboratory mice.
After a week in the artificial sunshine, endorphin levels in the blood of shaved animals increased.
At the end of six weeks, the mice were given an opioid-blocking drug, naloxone. Abruptly denied the drug-like effects of UV, they suffered an array of withdrawal symptoms, including shaking, tremors and teeth chattering.
In addition, UV exposure caused the animals' tails to stiffen and lift up - an effect also seen when mice are given opioid drugs.
When the mice were removed from the UV rays the symptom, known as "Straub tail", gradually faded away.
Mice not exposed to UV light did not display the same responses.
"It's surprising that we're genetically programmed to become addicted to something as dangerous as UV radiation, which is probably the most common carcinogen in the world," said Dr Fisher, whose findings appear in the journal Cell.
"We suspect that the explanation involves UV's contribution to vitamin D synthesis in the skin.
However, in the current time, there are much safer and more reliable sources of vitamin D that do not come with carcinogenic risk, so there is real health value in avoiding sunlight as a source of vitamin D."
British experts urged caution when extrapolating the results of the research to humans.
Dr Clare Stanford, reader in experimental psychopharmacology at University College London, said:
"This study does not provide the sort of evidence needed to show addiction to UV light in mice and it is even less certain that the work predicts addiction in humans.
"This would require testing whether the mice preferred UV light or non-UV light, which was not done in this paper.
"The strain of mice used in this experiment produce virtually no melatonin, which is thought to protect against damage from UV light. Shaving such mice and exposing them to UV light raises important ethical questions about animal welfare and again casts doubt on the relevance of the results to humans."
Dr Richard Weller, senior lecturer in dermatology at the University of Edinburgh, said: "Mice are nocturnal animals, covered in fur, which avoid the light, so one must be cautious about extrapolating from these experiments to man.
"Nonetheless, the authors discuss some literature suggesting that a similar pathway might also be present in man.
"It is very unlikely that evolutionary pressures would select for a trait which reduces survival and reproductive 'fitness'. If an 'addiction' to sun truly also exists in mankind, it suggests to me that there is a benefit to it.
"The authors mention vitamin D, but in addition to this, epidemiological data (particularly from Scandinavia) show that increased sun exposure is associated with reduced all-cause mortality.
"Our recent work shows how sunlight reduces blood pressure independently of vitamin D, which may account for some of the health enhancing effects of sun."