While there are myriad benefits to moderate sun exposure, the most important is probably vitamin D synthesis. Direct, unprotected exposure to sunlight is the human body's primary method of creating vitamin D -- UVB rays from the sun penetrate the skin, they react with a cholesterol precursor (7-dehydrocholesterol) to form vitamin D3 (cholecalciferol). In fact, just 15-20 minutes of sunlight can provide as much as 10,000 IU of vitamin D -- about 20-30 times more than you can get from a day's worth of food! Vitamin D created from sun exposure is also stored in the body much longer than that from food or supplements.
Aim for 15-30 minutes (or half of your typical burn time) of sun exposure to large skin surfaces at least three times per week. If you plan on being in the sun for an extended period of time, opt for a mineral-based sunscreen for better protection and reduced exposure to chemical agents.
For those living in regions with less sunshine, you may need to consider supplementation. Be sure it's in the form of vitamin D3 (cholecalciferol) for optimal absorption.