As you no doubt know, exposure to sunlight causes vitamin D to be produced in your skin. But it is only a portion of the solar spectrum known as UVB that has this effect. Other parts of the solar spectrum can have very different results.
Malignant melanoma has been increasing at an exponential rate in indoor workers since before 1940. The reason may be indoor exposure to UVA radiation. Unlike UVB, which is blocked by glass, UVA can pass through windows.
UVA can cause cancerous mutations, and can also break down vitamin D formed after outdoor UVB exposure. And vitamin D is a potent defense against melanoma -- melanoma cells convert it to calcitriol, which causes growth inhibition and apoptotic cell death in vitro and in vivo. New research shows that increased UVA exposures and inadequately maintained cutaneous levels of vitamin D promote melanoma.