Fireflies glow in the Santa Clara forest in Mexico. (Hilda Rios/EPA-EFE/REX/Shutterstock)

A biologist was studying bats in the tropics a few years ago and observed that the air was full of glowing, slow-flying insects. Jesse M. Barber was puzzled: How could an animal, which makes no evasive maneuvers of any sort, flash lights that ostensibly say “come eat me” still manage to thrive in a forest full of bats?

Barber, a biologist at Boise State University, knew that, although summery constellations of biochemical light are beautiful, fireflies do not flash for our pleasure. The insects cram a lot of information into their blinks — messages of life, death and reproduction. Along with his colleagues, Barber found evidence that firefly flashes contain more than a dating profile. It’s part warning, too: Don’t mess with this beetle.

The typical nocturnal insect goes out of its way to avoid a bat’s notice. Researchers in Barber’s lab call bats “sky wolves,” and though it’s a running joke, it is not far from reality. When providing milk to their pups, female little brown bats can eat their body weight in insects nightly, which means gobbling thousands of bugs.

These ferocious hunters exert an “incredible selective pressure on their prey,” Barber said. Insect species that can’t avoid or defend against bats are not long for this world.

In a study published Wednesday in the journal Science Advances, Barber and his colleagues introduced common eastern fireflies — Photinus pyralis — to a small group of big brown bats.

The researchers assumed that their bats had never seen a firefly before. “These bats are from the western United States, where there are essentially no fireflies,” Barber said. The only fireflies in that region do not produce light as adults.

The bats and fireflies coexisted in a dark room for one to four days. Each bat grabbed a firefly on the first day, then promptly spit it out. High-speed video cameras showed the bats eating scarab beetles and moths, but not fireflies.

The bats loathed the taste of fireflies. Barber said he’d never “seen a stronger negative reaction” to a chemically defended insect. The bats “salivate a bunch and they cough and shake their head and just generally completely despise us for giving them that prey.”

Fireflies might look like harmless nuggets of light, but they’re actually quite toxic. Study co-author Marc A. Branham, who studies insect behavior at the University of Florida, knows this because he experienced their “totally gnarly” taste firsthand.

“I had found a new species and was trying to catch as many species as I could in my net,” he said, when they began escape. Needing a bug-size enclosure, he held a few in his lips and mouth. The beetles were bitter, somewhat acidic, and Branham suspects they would have been even more noxious had he chewed. “As it was, my throat started constricting and my lips went numb.”

After the first taste, the bats didn’t try to eat the fireflies again. They associated the blinking lights with a disgusting meal, researchers concluded.

That firefly light is a warning to predators — don’t eat me, I’m gross — is not a new hypothesis. All fireflies glow as immature larvae — these young beetles cannot mate, ruling out worm-light as courtship ritual. Writing about adult fireflies in the late 1800s, entomologist George H. Bowles speculated, “May not the light then serve … as a warning of their offensiveness to creatures that would devour them?”

But this is the first direct experimental evidence to show that bats avoid the beetles, the study authors said. It turns out that the bats used not one but two signals: auditory and visual signs. “This is, to my knowledge, the first work to show that a three-dimensional flight pattern is information that bats can associate with bad taste,” Barber said.

In a follow-up test to examine the role of firefly light, the researchers painted fireflies red or black, carefully applying brushstrokes to block out the light organ on the firefly abdomen.

The bats that previously learned not to hunt fireflies had to relearn to avoid them. Without the fireflies' flashes, this process took longer, but the predators eventually recognized the flight patterns of the darkened beetles and stopped pursuing them.

Kathrin F. Stanger-Hall, a firefly expert at the University of Georgia who was not involved with the research, noted that the paint-blocking tests were particularly elegant. Bats use echolocation to sense the wing beats of the fireflies, which have characteristically lazy flight patterns. The authors called it the “nonchalance of a chemically protected insect." Barber likened it to the unhurried waddle of a prickly porcupine.

The study presents "convincing evidence that bats of this particular species learned to avoid fireflies more quickly when they received information through two different sensory channels,” said Sara M. Lewis, a biologist at Tufts University and the author of “Silent Sparks: The Wondrous World of Fireflies.” Lewis was not involved with the research.

It was the combination of the flight pattern and the blinking light that drove the message to the bats, Lewis said. "Flying plus bioluminescence was the magic combination that really enhanced bats’ avoidance learning.”

Barber, Branham and their co-authors conclude that these anti-bat signals might be why adult fireflies evolved the ability to flash at night. The oldest known firefly ancestor communicated with mates using pheromones, which is a chemical scent akin to perfume; its descendants later evolved the ability to court mates with light. The scientists make a bold prediction in their paper, suggesting that “bats may have invented fireflies.”

Branham said the family tree of fireflies and bats both branch around the same time. The timing is not conclusive, but it is suggestive, he said. “With all of the data that is currently available, it certainly appears as though the first bioluminescent fireflies first arose around the same time as bats,” Branham said.

Stanger-Hall, however, wasn’t convinced by this possible ancient bat-and-firefly tango. “Any discussion on how bats may have impacted the evolution of firefly bioluminescence is pure speculation,” she said, “and certainly does not apply to larval bioluminescence, which defines fireflies.” Grubs, Stanger-Hall noted, typically have to worry about such predators as toads and lizards, not bats.

“Many of their signature traits seem to have evolved hand-in-hand with their chemical defenses,” Lewis said. “We know a little about what exactly it is that makes certain fireflies so distasteful to predators, but it’s kind of surprising that we don’t know more.”

To confirm whether this study reflects bat-firefly interactions outside the lab, Barber plans to study bat droppings for traces of firefly remains.

Read more:

These creatures use glowing vomit to attract mates — and it’s utterly beautiful

Here’s why mushrooms glow in the dark

Scientists built a special camera to study glow-in-the-dark sharks