From Scientific American:
In research that could give doctors a way to reassign sex in cases of unclear gender, scientists report this week that they have figured out why some children with genes that should make them boys are instead born as girls. The study, published in Nature, explains why some embryos with X and Y chromosomes—which should be born as male—develop ovaries and eventually become girls.
The key is whether a gene called Sox9, involved in formation of the testes, is active. “There are a surprisingly large number of cases where this process goes wrong,” says Robin Lovell-Badge, a biologist at London’s MRC National Institute for Medical Research, who estimates that this phenomenon could effect up to 1 in every 20,000 genetic males. “Maybe one could treat some of these sex reversal or intersex cases after birth by manipulating whether Sox9 is active or not. This is all speculation but it’s possible.”
If Sox9 is somehow switched on in a genetic female—an embryo with two X chromosomes—it causes male gonads to form; if it fails to turn on in males, the cells it controls will become follicle cells, which mature into ovaries.
More here.