"The adult flies actually anticipate an infection risk to their children, and then they medicate them by depositing them in alcohol," Todd Schlenke, the evolutionary geneticist whose lab did the research, said.
"We found that this medicating behavior was shared by diverse fly species, adding to the evidence that using toxins in the environment to medicate offspring may be common across the animal kingdom," he said.
Adult fruit flies detect the wasps by sight, and appear to have much better vision than previously realized, he added.
"Our data indicate that the flies can visually distinguish the relatively small morphological differences between male and female wasps, and between different species of wasps," he said.
The experiments were led by Balint Zacsoh, who recently graduated from Emory with a degree in biology and still works in the Schlenke lab. The team also included Emory graduate student Zachary Lynch and postdoc Nathan Mortimer.
The larvae of the common fruit fly, Drosophila melanogaster, eat the rot, or fungi and bacteria, that grows on overripe, fermenting fruit. They have evolved a certain amount of resistance to the toxic effects of the alcohol levels in their natural habitat, which can range up to 15 percent.
Tiny, endoparasitoid wasps are major killers of fruit flies. The wasps inject their eggs inside the fruit fly larvae, along with venom that aims to suppress their hosts' cellular immune response.
If the flies fail to kill the wasp egg, a wasp larva hatches inside the fruit fly larva and begins to eat its host from the inside out.
Last year, the Schlenke lab published a study showing how fruit fly larvae infected with wasps prefer to eat food high in alcohol.
This behavior greatly improves the survival rate of the fruit flies because they have evolved high tolerance of the toxic effects of the alcohol, but the wasps have not.
"The fruit fly larvae raise their blood alcohol levels, so that the wasps living in their blood will suffer," Schlenke said.
"When you think of an immune system, you usually think of blood cells and immune proteins, but behavior can also be a big part of an organism's immune defense," he said.
The findings are published in the journal Science.