What does sunlight do for your bones, independent of vitamin D?
Sunlight has no demonstrable direct effect on your bones beyond vitamin D. All bone benefits of sun run through the vitamin D your skin produces, and production via sunlight is safer than high supplementation doses.
The available studies do not describe a single bone effect of sunlight that is independent of vitamin D. Everything sunlight does for your bones runs through one pathway: UVB radiation converts a precursor in the skin into vitamin D, and that vitamin D then regulates bone formation.
What vitamin D does through that pathway is genuinely important. Too little sun leads to a deficiency, and in children that deficiency can cause rickets, a condition in which bones become soft and deformed. In adults it leads to osteomalacia, a painful bone condition, or to accelerated bone loss that can progress to osteoporosis.
In older people living in care homes who rarely go outside, extra vitamin D combined with calcium led to slightly better bone density and fewer fractures. The effect on fractures does vary across studies, however, and appears to be greatest in people who already have a substantial deficiency.
One important advantage of sun over supplements: you cannot overdose on vitamin D through sunlight. The skin automatically stops producing it once there is enough. With high-dose vitamin D supplements the situation is different. In one large study in postmenopausal women, 400 IU of vitamin D combined with 1000 mg of calcium led to more cases of kidney stones compared with a placebo.
If you spend little time outdoors, are pregnant or breastfeeding, and also get little vitamin D from food, there is an increased risk of deficiency. In that case supplementation is worthwhile, but discuss the right dose with your doctor or midwife.
Based on multiple RCTs, observational studies and reviews (PMID 18088161, 17604580, 6350405, 12730486, 18801384). None of the sources describes a vitamin D-independent bone effect of sunlight.