(RunPhoto/Getty Images)

Michael F. Holick is a professor of medicine, physiology and biophysics at Boston University Medical Center.

For decades now, our sun has been reviled and demonized. The message from the medical community: Avoid direct exposure, or face an increased risk of skin cancer. As the American Cancer Society helpfully put it in one ad campaign: “Fry Now. Pay Later.” The American Academy of Dermatology recommends never exposing bare skin to the sun, or even a cloudy sky, without sunscreen. The Food and Drug Administration calls ultraviolet radiation a carcinogen. These messages have caused widespread paranoia about sunlight, especially among parents who religiously apply sun protection multiple times a day on their children. After TV chef Nigella Lawson was photographed covered head to ankle in a black “modesty” swimsuit at the beach, she explained that she didn’t want to get burned.

But while we need to avoid cancer, we also need vitamin D, and the sun is the only reliable way to get it outside of a daily supplement. Australia’s decades-long public campaign to curb its skin cancer rates and encourage less sun exposure has been unfortunately effective: 31 percent of Australian adults are now vitamin D deficient, which is linked with a number of serious and deadly conditions, including several cancers. Sunscreen dramatically limits the production of vitamin D — SPF 30 reduces it by 97 percent. Meanwhile, the risks associated with sensible sun exposure have been exaggerated by well-meaning health authorities, and the measures to guard against them often have nothing to do with the sun’s occasionally malignant effects. Contrary to the paranoia generated by years of messaging, the sun is not our enemy. It’s safe to step back outside — and, please, go easy on the sunscreen.

Vitamin D has a number of crucial functions. It’s actually a hormone, and its active form is responsible for regulating the absorption of dietary calcium and phosphorus, two nutrients essential for bone health and neuromuscular activity. Vitamin D also regulates cellular growth, keeping cells healthy and helping to prevent them from becoming malignant. A recent study found that adults who increased their vitamin D intake during the winter enhanced 291 genes in their circulating immune cells. These genes control more than 80 biologic processes, including helping cells repair their damaged DNA, promoting the death of cells that are in the process of becoming cancerous and improving immune function to help fight infections.

A lack of vitamin D is associated with increased risk for Type 1 and 2 diabetes, multiple sclerosis, rheumatoid arthritis, Crohn’s disease, cardiovascular disease, stroke, depression, Alzheimer’s disease, schizophrenia, colon and breast cancer, influenza and tuberculosis. Vitamin D deficiency is more likely to occur at higher latitudes and in the winter, when the angle of the sun is more oblique; in the 1940s, doctors found that living at higher latitudes increased the risk of dying of cancer. Of the 30 leading causes of deaths in the United States in 2010, 19 were linked to low vitamin D status.

Vitamin D deficiency in pregnant women has been associated with a higher risk of preeclampsia, which can cause fatal complications. Women lacking the vitamin are three times more likely to require a Caesarean section compared with women who are vitamin D sufficient at the time they give birth. Poor birth outcomes have also been associated with in-utero vitamin D deficiency, and those infants and young children are more likely to develop wheezing disorders.

Conversely, exposure to more sun, and the subsequent increased vitamin D, is good for you. Living below a latitude similar to that of Los Angeles and Atlanta for the first 10 years of life reduces the risk of developing multiple sclerosis by more than 50 percent, and those who were born and live near the equator are 15 times less likely to develop Type 1 diabetes compared with people living in more northern or southern latitudes. A study in Canada revealed that women who had the most sun exposure as teenagers and young adults reduced their chance of developing breast cancer later in life by almost 70 percent.

We simply aren’t getting enough vitamin D. The USDA’s 2015 Dietary Guidelines Advisory Committee placed the compound high on its list of underconsumed nutrients; it also identified vitamin D deficiency as a public health threat. There are few dietary sources for vitamin D. Fortified foods including milk, orange juice, margarine and cereals have small amounts; oily fish, cod liver oil and sun-dried mushrooms have some, but you can’t subsist on those. This means we must rely on the sun, just as our hunter-gatherer ancestors did.

When we are exposed to sunlight, more than 200 different packets of energy enter our skin. The photons with the lowest wavelengths, ultraviolet B (UVB) radiation, have the most energy and are efficiently absorbed in the upper layer of the skin by DNA, RNA and proteins as well as many small molecules, including 7-dehydrocholesterol, which is eventually converted to vitamin D. UVB stimulates the production of melanin, a natural sunscreen that protects the skin from the damaging effects of excessive sun exposure, and beta endorphin, which helps create the “runner’s high” and a feeling of well-being.

Ultraviolet A (UVA) radiation has less energy. These photons are not efficiently absorbed in the epidermis and penetrate more deeply, initiating the production of nitric oxide. The nitric oxide causes smooth muscle relaxation, leading to a widening of blood vessels and lower blood pressure. It improves circulation in the skin, thereby enhancing wound healing, especially in patients with diabetes. It also causes gastrointestinal smooth muscle relaxation and is involved in learning and memory. UVA radiation causes immune suppression, decreasing inflammatory skin conditions and allergic asthma.

It would be wrong and foolish, of course, to say that sun exposure isn’t dangerous. Just as sunlight triggers the crucial production of vitamin D, it also sets in motion negative processes. Excessive exposure to the sun damages DNA in skin cells, which in turn can cause nonmelanoma skin cancer. Solar UVA radiation produces free radical oxygen, a potent oxidant, in the skin, leading to wrinkles and damage; it also depresses immune reactions that normally destroy developing skin tumors, resulting in increased risk for skin cancer. Additionally, this suppression can decrease resistance to some infectious diseases of the skin and lower immune response to some vaccines. More than 3.5 million skin cancers are diagnosed in more than 2 million people in the United States annually. An estimated 1 in 5 Americans will develop skin cancer in their lifetimes. This is not insignificant.

Faced with high cancer rates, health authorities have rushed to damn the sun without taking into account the many scientifically documented health benefits it provides. Along the way, the danger of sun exposure has been exaggerated. Melanomas cause more than 9,000 deaths each year, but they account for only 5 percent of skin cancer. What’s more, most melanomas occur on the least sun-exposed parts of the body, such as the buttock, the upper arms and the back of the legs. People who work outdoors actually have lower incidences of melanoma, despite spending significantly more time in the sun than office workers.

So how do we get sun responsibly, balancing the benefits against the risks? It’s complicated. The time of day, season, latitude and degree of skin pigmentation all influence how much vitamin D is produced in the skin. The Institute of Medicine recommends that children over the age of 1 and adults up to 70 should receive 600 units daily of vitamin D; for reference, research shows that an adult in a bathing suit who is exposed to the sun long enough to produce a light pinkness of the skin 24 hours later has gotten the equivalent of 15,000 IUs. I suggest to my patients that they go out in the sun between 10 a.m. and 3 p.m. (very little if any vitamin D is produced outside those hours) for half the time it would take them to develop a mild sunburn — while covering the face and hands with sunscreen but leaving other parts of the body exposed. After this exposure, I urge them to use sun protection to prevent burning.

The recommendation to avoid sunlight is based on the premise that this reduces the risk of skin cancer, including the most deadly form, melanoma. Yet abstinence hasn’t worked: Skin cancer rates continue to increase unabated, and vitamin D deficiency — and the many ills associated with it — is rising. Health-care organizations need to recognize, as the World Health Organization does, that small amounts of UV are beneficial and essential to the production of vitamin D. The sun, used sensibly, is not to be feared.

mfholick@bu.edu

Read more from Outlook and follow our updates on Facebook and Twitter.