As adults, the earliest fireflies probably communicated with chemical signals, the way some firefly species do today. Only much later did some firefly species gain through evolution the ability to make light as adults. Instead of a warning, the light became a mating call. (An enzyme in the firefly’s tail drives a chemical reaction that makes light.)

Image RESEARCHER Sara Lewis is an evolutionary ecologist at Tufts University who studies firefly mating habits. Credit... Melody Ko/Tufts University

The more Dr. Lewis watched firefly courtship, the clearer it became that the females were carefully choosing mates. They start dialogues with up to 10 males in a single evening and can keep several conversations going at once. But a female mates with only one male, typically the one she has responded to the most.

Dr. Lewis wondered if the female fireflies were picking their mates based on variations in the flashes of the males. To test that possibility, she took female fireflies to her lab, where she has computer-controlled light systems that can mimic firefly flashes. “You can play back specific signals to females and see what they respond to,” Dr. Lewis said.

The female fireflies turned out to be remarkably picky. In many cases, a male flash got no response at all. In some species, females preferred faster pulse rates. In others, the females preferred males that made long-lasting pulses.

If females preferred some flashes over others, Dr. Lewis wondered why those preferences had evolved in the first place. One possible explanation was that the signals gave female fireflies a valuable clue about the males. Somehow, mating with males with certain flash patterns allowed females to produce more offspring, which would inherit their preference.

It is possible that females use flashes to figure out which males can offer the best gifts. In many invertebrate species, the males provide females with food to help nourish their eggs. Dr. Lewis and her colleagues discovered that fireflies also made these so-called nuptial gifts  packages of protein they inject with their sperm.

Dr. Lewis is not sure why she and her colleagues were the first to find them. The gifts form coils that can take up a lot of space in a male firefly’s abdomen. “They’re incredibly beautiful,” she said.