A tissue called the hair follicle surrounds the root of every strand of hair. Each follicle contains pigment cells that produce melanin, the chemical that gives hair its color. As a person ages the pigment cells in the hair follicles gradually die. When there are fewer pigment cells the strand of hair does not contain as much melanin and becomes a more transparent color such as white, silver or gray.
Source: http://kidshealth.org/kid/grownup/getting_older/gray_hair.html