SEATTLE — The epiphany that mushrooms could help save the world's ailing bee colonies struck Paul Stamets while he was in bed.

"I love waking dreams," he said. "It's a time when you're just coming back into consciousness."

Years ago, in 1984, Stamets had noticed a "continuous convoy of bees" traveling from a patch of mushrooms he was growing and his beehives. The bees actually moved wood chips to access his mushroom's mycelium, the branching fibers of fungus that look like cobwebs.

"I could see them sipping on the droplets oozing from the mycelium," he said. They were after its sugar, he thought.

Decades later, he and a friend began a conversation about bee colony collapse that left Stamets, the owner of a mushroom mercantile, puzzling over a problem. Bees across the world have been disappearing at an alarming rate. Parasites like mites, fast-spreading viruses, agricultural chemicals and lack of forage area have stressed and threatened wild and commercial bees alike.

Waking up one morning, "I connected the dots," he said. "Mycelium have sugars and antiviral properties," he said. What if it wasn't just sugar that was useful to those mushroom-suckling bees so long ago?

In research published Thursday in the journal Scientific Reports, Stamets turned intuition into reality. The paper describes how bees given a small amount of his mushroom mycelia extract exhibited remarkable reductions in the presence of viruses associated with parasitic mites that have been attacking, and infecting, bee colonies for decades.

In the late 1980s, tiny Varroa mites began to spread through bee colonies in the United States. The mites — which are parasites and can infect bees with viruses — proliferate easily and cause colony collapse in just years.

Over time, colonies have become even more susceptible, and viruses became among the chief threats to the important pollinators for crops on which people rely.

"We think that's because the viruses have evolved and become pathogenic and virulent," said Dennis vanEngelsdorp, a University of Maryland professor in entomology, who was not involved in the mycelium research. "Varroa viruses kill most of the colonies in the country."

He likened the mites to dirty hypodermic needles; the mites are able to spread viruses from bee to bee.

The only practical solution to date has been to keep the number of Varroa mites within beehives "at manageable populations."

Stamet's idea about bee-helping mycelium could give beekeepers a powerful new weapon.

Steve Sheppard, a Washington State University entomology professor, has heard a lot of wild ideas to save bees over the years, like harnessing static electricity to stick bees with little balls of Styrofoam coated in mite-killing chemicals. Stamets' pitch was different: He had data to back up his claims about mycelium's antiviral properties and his company, Fungi Perfecti, could produce it in bulk. "I had a compelling reason to look further," Sheppard said.

To test Stamets' theory, the researchers conducted two experiments: They separated two groups of mite-exposed bees into cages, feeding one group sugar syrup with a mushroom-based additive and the other, syrup without the additive. They also field-tested the extract in small, working bee colonies near WSU.

For several virus strains, the extract "reduced the virus to almost nothing," said Brandon Hopkins, a WSU assistant research professor, another author of the paper.

Because the extract can be added to syrups commercial beekeepers commonly use, researchers say the extract could be a practical solution that could scale quickly.

Meanwhile, Stamets has designed a 3D-printable feeder that delivers mycelia extract to wild bees. He plans to launch the product, and an extract-subscription service next year, to the public.

"The loss of biodiversity has ramifications that reverberate throughout the food web," Stamets said, likening each species to parts of an airplane, that hold the Earth together — until they don't.

"What rivet will we lose that we'll have catastrophic failure? I think the rivet will be losing the bees," he said. "More than one-third of our food supply is dependent on bees."