We tend to think of time spent outdoors in the sunshine as beneficial to health, and it can be; but some sun worshippers may actually need the sun the way an alcoholic needs a drink. Those who crave the sun have a lot in common with other types of addicts, a new study has found.

Everyone loves a sunny day, but some people are sun-obsessed. They are the people who head to tanning salons even though they know that UV exposure can cause skin cancer. They may feel depressed without it even during summer months, unlike those who experience seasonal affective disorder during the short, often dark days of winter.

Researchers at Harvard Medical School found that sun exposure can lead to physical dependence, tolerance, and addiction-like behavior. Though their work was done in mice, exposure to ultraviolet (UV) radiation — basking in the sun — triggers the release of endorphins, the feel-good hormones associated with drug addiction and runner's high in people.

If you are among the sun-addicted, (you know who you are), you need to plan to stay out of the sun, otherwise you are likely get too much exposure.

This can help explain why something we know is so bad for us can feel so good. Endorphins relieve pain; they activate the same opiate receptors as alcohol, prescription painkillers, morphine, and heroin.

In fact, as the authors write, to better protect people from the cancer-causing rays of the sun, it may be useful “to view recreational tanning and opioid drug abuse as engaging in the same biological pathway.”

The team exposed mice to UV light for six weeks and found that endorphin levels in the bloodstream increased within one week. After the six-week period ended, mice that had been exposed to UV light were given an opioid-blocking drug. They developed withdrawal symptoms, including shaking, tremors, and teeth chattering, and avoided places where they had been given the drug, suggesting that chronic UV exposure produces physical dependence and addiction-like behavior.

It's not yet clear why sunlight has this effect on the body, but its role as a source of vitamin D may have something to do with it.

“We suspect that the explanation involves UV's contribution to vitamin D synthesis in the skin,” senior study author David Fisher said in a statement. “However, 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.”

If you are among the sun-addicted, (you know who you are), you need to plan to stay out of the sun, otherwise you are likely get too much exposure. Buy a hat with a broad brim. When you hit the beach this summer, use sunscreen and cover up; bring an umbrella.

As Fisher says, “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.”

The study is published in Cell.