The most abundant form of vitamin D is D3, called cholcalciferol. Vitamin D is not technically a vitamin, because it is not required in the diet. It arises from uv-photolysis of 7-dehydrocholesterol, an intermediate in cholesterol biosynthesis (see here).
Vitamin D regulates calcium and phosphorus metabolism, particularly the synthesis of the inorganic matrix of bone, which consists largely of calcium phosphate.
D3 undergoes two successive hydroxylations catalyzed by mixed-function oxidases. The first occurs at carbon 25 in liver. When calcium levels are low, hydroxylation occurs at carbon 1, yielding the active form, 1,25(OH)D3, which stimulates osteoblasts to take up calcium. In the intestine, 1,25(OH)D3 stimulates transcription of a protein that stimulates calcium absorption into the bloodstream. When calcium levels are adequate, hydroxylation occurs instead at carbon 24, yielding the inactive 24,25(OH)D3 form.
See also: Lipid-Soluble Vitamins, Steroid Metabolism, Dimethylallyl Pyrophosphate, Isopentenyl Pyrophosphate