Bacteria inside the gut can synthesize vitamin D. The fat-soluble vitamin D regulates calcium and phosphate metabolism and bone health. As well as dietary sources such as fatty fish and fortified dairy products, sunlight can also synthesize it in the body.