Fireflies glow to lure prey, discourage predators, and most importantly to attract mates. The characteristic green-yellow glow produced by a firefly is the result of a chemical reaction that takes place in the insect's abdomen.
The rate and wavelength at which female fireflies produce flashes is the key to attracting a mate. There are numerous species of fireflies glowing in the night sky in the same place. By emitting light at different intervals and glowing at different wavelengths, the various species are able to distinguish among one another.