Ergosterol when irradiated with ultraviolet light, ring B is opened to form vitamin D2 (ergocalciferol) in a process similar to that which forms vitamin D3 (cholecalciferol) from
7-dehydrocholesterol (precursor of vitamin D)