The medical term for hair graying is canities. Hair turns gray (or white) when your hair follicles stop creating melanin. Melanin is the substance that gives your skin and hair color.