Vitamin D is a hormone produced by the body in response to direct exposure of skin to strong ultraviolet B rays from the sun. Vitamin D also encourages cell growth and immune function, which keeps your nervous system working properly.