When you’re sick, you go see the doctor, and then, illegible prescription slip in hand, pick up some medicine at the drug store. But what can a bee do when it's feeling bad? It’s not like they can stop by CVS on the way back to the hive. According to new research, though, bees do have a place to turn to when they're sick.

Since plants can’t pick up and run away from danger, they need other ways of defending themselves. Some grow thick bark or thorns, while others produce defensive chemicals that make them unpalatable or toxic to the animals that might eat them. Some of these chemical weapons can also benefit animals, and biologist Leif Richardson has found that a handful of defensive compounds found in floral nectar and pollen can help bees battle infections.

Richardson and a team of researchers from Dartmouth College and the University of Massachusetts discovered this by getting some bees sick and then offering different cures for what ailed them. They infected a group of eastern bumblebees (Bombus impatiens) with an intestinal parasite called Crithidia bombi, which can shorten bees’ lifespans, alter their behavior, and hamper their reproduction, and which has been fingered as one of the suspects in the decline of North American bumblebees. Then, they fed the bees sugary solutions that contained one of eight different nectar chemicals found in the plants they normally pollinate.

A week later, they euthanized the bees, dissected them and counted the parasite cells in their guts. Half of the nectar compounds had some effect and reduced the bees’ parasite loads. The best “drug” in the floral medicine cabinet was anabasine, which cut the parasite load by more than 80 percent. The bees that ate the anabasine—an alkaloid found in tobacco plants—were more likely to be completely parasite-free after a week than their friends that ate the plain sugar solution. The researchers think the chemical might be toxic to the parasites or disrupt their transition from one life stage to another, or it could boost the bees' immune response.

Unfortunately, clearing a Crithidia infection quickly didn’t help individual bees that much, and they still died sooner than bees that didn’t have the parasites. Consuming the chemical and fighting the infection still benefit a bee’s colony, though. Crithidia leaps from host to host through an infected bee’s feces, and can quickly spread through a hive that’s been contaminated or reach other hives via contaminated flowers. By reducing the intensity of infection in individual bees, the researchers say, the nectar chemicals make parasite transmission in and between hives harder.

Lots of medications have side effects, and since these nectar compounds are defenses for plants, the researchers expected there would be some cost to consuming them as well as a benefit. After raising groups of infected and uninfected female bumblebees on either a plain sugar solution or one with anabasine in it, though, they found that the chemical didn’t have any adverse effects on the bees’ lifespans and the only problem it caused was a short delay in reaching the egg-laying stage.

The scientists aren’t sure if bumblebees deliberately seek out anabasine and other parasite-fighting compounds when they’re sick, but other studies suggest that the bees do switch up the flowers they visit when they’re carrying parasites and that honey bees “self-medicate” by collecting more anti-fungal plant resins after an infection in their hive. The researchers think that if the bees do know to look for certain chemicals to fight infections, then the plants that contain them could be planted near struggling bee populations to act as floral pharmacies that provide preventative medicine.