The unexpected relationship of hair color to pain tolerance appears to exist because redheads have a mutation in a hormone receptor that can apparently respond to at least two types of hormones: the pigmentation-driving melanocyte-stimulating hormone (MSH), and the pain-relieving endorphins. (Both derive from the same precursor molecule, POMC, and are structurally similar. ) Specifically, redheads have a mutated melanocortin-1 receptor (MC1R) gene that produces an altered receptor for MSH.  Melanocytes, the cells that produce pigment in skin and hair, use the MC1R to recognize and respond to MSH from the anterior pituitary gland. Melanocyte-stimulating hormone normally stimulates melanocytes to make black eumelanin, but if the melanocytes have a mutated receptor, they will make reddish pheomelanin instead. MC1R also occurs in the brain, where it is one of a large set of POMC-related receptors that are apparently involved not only in responding to MSH, but also in responses to endorphins and possibly other POMC-derived hormones.  Though the details are not clearly understood, it appears that there is some crosstalk between the POMC hormones; this may explain the link between red hair and pain tolerance.