Scientists have pinpointed the molecular on-off switch that the powerful drug tamoxifen uses to attack breast cancer and which prevents it from working in some women.

That discovery should eventually help doctors test for resistance to the drug, the chief treatment for breast cancers that are estrogen-driven, researchers said. Tamoxifen doesn't work in about one-quarter to one-third of women who are treated with it.

A test for resistance based on the research, published in Thursday's editions of the journal Nature, is probably about five years away, said study co-author Jason Carroll, a cancer researcher at the Cambridge Research Institute in the United Kingdom.

Tamoxifen turns off a gene that causes tumors to grow, but sometimes it fails in a molecular tug-of-war with another protein, and that's when the drug doesn't work, Carroll said.

"If that switch fails, the tamoxifen fails," he said. "The switch is hidden in the background of the genome in the gene itself."

About 40,500 women die each year of breast cancer in the United States, according to the American Cancer Society.