Multiple sclerosis (MS) is a major inflammatory and demyelinating disease of the central nervous system and has an increasing prevalence in populations residing at higher latitudes. This observation may indicate a protective effect of sunlight exposure, which is reduced at higher latitudes and may contribute to insufficient levels of vitamin D in the MS population. The vitamin D hormone is important for bone metabolism and can regulate cell proliferation and differentiation as well as apoptosis and immune regulation in immune cells such as T helper cells and dendritic cells. Evidence from experimental autoimmune encephalomyelitis and prospective studies on MS suggests an important role of vitamin D as a modifiable environmental factor in MS. These provide guidance for future studies with regard to the potential role of vitamin D in the prevention and/or treatment of MS. Here, we first review the metabolism and immune functions of vitamin D. Then, we describe the current thinking on the etiology of vitamin D in MS and the accumulating evidence pointing to a link between vitamin D and MS. Further, we describe how genetic susceptibility interacts with environmental risk factors at the population level, MS-associated risk factors, and genetic studies related to the vitamin D receptor. This review also discusses the therapeutic potential of vitamin D for treating MS.