Marie Antoinette's hair turned white overnight, according to folklore, before she was executed by guillotine in 1793 during the French Revolution. The ill-fated queen embodied an extreme example of the phenomenon of stress-induced graying of the hair.

The biological mechanism behind such graying had long remained a mystery. But researchers said Wednesday they have figured out how it happens: It is driven by the body's "fight-or-flight" response to danger.

The researchers used mouse experiments to look at how stress affects the stem cells in hair follicles that are responsible for making melanocytes, the pigment-producing cells that give hair its color — black, brown, blond, red or somewhere in between. People generally have around 100,000 hair follicles on their scalp.