Even low levels of light in bedrooms may stop breast cancer drugs from working, US researchers have warned.
Animal tests showed light, equivalent to that from street lamps, could lead to tumours becoming resistant to the widely used drug Tamoxifen.
The study, published in the journal Cancer Research, showed the light affected sleep hormones, which in turn altered cancer cell function.
UK experts said it was an intriguing finding, but not proven in people.
Tamoxifen has transformed the treatment of breast cancer by extending lives and increasing survival times.
It stops the female hormone oestrogen fuelling the growth of tumours although the cancerous cells may eventually become resistant to the drug.
Researchers at the Tulane University School of Medicine investigated the role of the body clock in Tamoxifen resistance.
They focused their research on the sleep-promoting hormone melatonin, which normally begins to rise in the evening and continues through the night, before falling away as dawn approaches.
However, light in the evening - such as from a smartphone, tablet or artificial lights - can lower melatonin levels.
Rats, with human breast cancer and treated with Tamoxifen, were left to sleep in a completely dark cage or one that had dim light.
The scientists showed that in dim light, melatonin levels were lower, the tumours were bigger and were resistant to Tamoxifen.
A second set of tests showed that giving those mice melatonin supplements kept Tamoxifen working and resulted in smaller tumours.
Dr Steven Hill told the BBC News website: "I'm not advocating people buy melatonin over the counter, there's not enough evidence.
"But they could make sure they sleep in a room that is completely dark or they could wear eye-masks to let night-time melatonin rise and take Tamoxifen right before going to bed, that would be the easiest way to see if it works."
Some studies have suggested that melatonin may improve cancer treatments.
It has been suggested that the hormone calms down cancer cells, which are working on overdrive, to slow down the processes needed to develop resistance.
Dr Hill wants to move the research into human breast tissue.
He did add a warning about using technology, which tends to produce blue light wavelengths that disrupt melatonin production, in the run-up to bedtime.
"If you get seven hours sleep at night, but use an iPad or computer or watch TV then those blue wavelengths are suppressing melatonin production for anywhere from an hour to an hour and half.
"So instead of seven hours of melatonin, you're getting six or five and a half."
Dr Samuel Godfrey, from the charity Cancer Research UK, said: "The link between developing drug-resistant breast cancer and sleeping in dim light is an intriguing one, but it's important that we remember this link was found after studying a small number of rats implanted with breast cancer cells, not humans.
"More research in people is needed before we know whether the same mechanisms are at work in people."