Fireflies are nocturnal insects. Despite the name, they aren’t flies, but rather a type of winged beetle. The light produced by fireflies is a chemical reaction used to signal members of the opposite gender.
Each firefly species has its own distinctive flash patterns. Sometimes, they even blink in unison! Flash patterns range from continuous glows or single flashes to series of multi-pulsed flashes. The light produced by the firefly is the most efficient light ever made.
Almost 100% of the energy in the chemical reaction is emitted as light; in comparison, an incandescent light bulb only emits 10% of its energy as light, the other 90% is lost as heat.
The glow of firefly larvae (glow worms) serves a different purpose by frightening away potential predators. Fireflies are reportedly extremely nasty tasting and some species may be poisonous.