According to many investigators and perhaps people seeking tidy hypotheses to explain evolutionary change, humans were black in the tropics where our species originated, to protect from the dangers of too much sun. Even with dark skin, they got so many rays that they were able to make enough vitamin D. Vitamin D is obtained primarily by the effects of UV (solar) radiation enabling a vitamin-D producing reaction in the skin and only minimally by diet.
So we moved north, where there was less sunlight, and (as the story goes) were selected for lighter skin so we would not suffer disease due to vitamin D deficiency. Such diseases supposedly include osteoporosis or other bone disease -- though if you believe the current hype, vitamin D deficiency (and how that's determined is another story; current thresholds would suggest that almost everyone is deficient) causes almost anything, from diabetes to cancer. Whites get more UV light because, though there's less exposure in the high latitudes, they have less UV-filtering melanin in their skin.
So far so good. But the lore on the relevant bone disease is 'fat, fair, female, and forty'. Blacks as a group (in Europe and the US) do not have as much vit D deficiency-related problems, including osteoporosis, as whites. They do not get lots of rays in the north (or deep southern hemisphere) but they don't need vit D supplements to reduce risk of fractures.
Now, a new study shows that whites who have vit D deficiency suffer strokes at a higher rate. Blacks are known to have higher rates of strokes in generally, but it's whites who apparently have higher stroke risk if they're vit D deficient. This seems backward from the long-standing evolutionary story (or is it a Just-So story?), and it's not clear why. But what it does suggest is that lighter skin may not have evolved by natural selection in relation to vitamin D per se.
Strokes are serious, often crippling or fatal. Usually, and probably much more so in pre-industrial times, strokes are rare or post-reproductive, so they have little impact on evolutionary fitness (natural selection). Blacks in western environments have a higher risk of stroke, but this is generally thought to be due to the effects of lifestyle. Many have argued that this (and the associated high blood pressure) is genetic--and all sorts of largely fanciful explanations have been offered for it (for example, that slaves whose bodies did not conserve salt died on the Middle Passage from Africa to the Americas). But careful work by investigators including Charles Rotimi of NIH and Richard Cooper at Loyola Medical school in Chicago, both prominent and capable, have cast doubts on genetic explanations for this health difference.
Lighter skin has evolved at least twice (Europe and Asia) as people expanded north away from the tropics, and darker skin has evolved as Native Americans expanded from the arctic into the American tropics. A recent and very good PhD student of our Department, Ellen Quillen, has shown in her dissertation some evidence for selection in at least a few genes related to pigment production. There are always questions to be asked about this kind of research, and some important points have not yet been pinned down completely. But at least it shows that evolutionary hypotheses related to skin color make considerable plausible sense. But, then, what was the selective factor, if not health related to vitamin D?
We don't have the answer. Except that ready acceptance of selective scenarios, rather than more careful and cautious approaches, is too often a part of evolutionary biology, and perhaps especially when it comes to humans. We hunger to understand, but perhaps we also hunger too much to proffer hypotheses that are not fully baked.