Over-exposure to the sun's ultraviolet (UV) rays can damage the skin and trigger skin cancer.
However, new research involving more than 200,000 women suggests sunshine can also cut the risk of rheumatoid arthritis (RA) by more than one-fifth.
The findings are based on data from the Nurses' Health Study, looking at lifestyle factors affecting women's health in the US.
Scientists looked at conditions where the women lived to work out their likely exposure to UV-B rays.
The researchers used a measurement method known as UV-B flux which takes into account latitude, altitude and cloud cover.
It is expressed in R-B units, and a count of 440 R-B units in 30 minutes would produce slight redness in untanned white skin.
Exposure ranged from an annual average of 93 R-B units in the northern states of Alaska and Oregon to 196 in Hawaii and Arizona.
During the 30-year study period, a total of 1314 women developed RA, an auto-immune condition that attacks the joints.
Those with the highest levels were 21% less likely to develop the disease than those with the lowest, the research published in the journal Annals of the Rheumatic Diseases found.