Main function of a firefly’s glow is to lure prey, attract mates or discourage predators.
Fireflies which are also called lightning bugs have a characteristic green-yellow glow in result of a chemical reaction that takes place in the insect’s abdomen. This chemical reaction involves three ingredients: luciferin (a heat-resistant substrate and serves as the source of the light), luciferase (an enzyme that triggers the light-producing chemical reaction), and oxygen (provides the fuel for the reaction to proceed).
The rate and wavelength at which female fireflies produce flashes is related to the attracting of a mate. It is so important because it helps to note that the common name ‘fireflies’ does not refer to a single species of insect. Instead, there are numerous species of fireflies, many of which are glowing in the night at just about the same time in just about the same places.