Vitamin D is important for bone and muscle health and may help prevent diseases. It is produced by sunlight exposure and is important for calcium absorption. A lack of vitamin D can lead to rickets in children, causing soft and misshapen bones, and osteomalacia in adults, causing bone pain and weakness. While vitamin D deficiency has negative health effects, too much can also be harmful.