The firefly is a nocturnal beetle whose rhythmic flashes of light are perhaps a means of sexual attraction, perhaps a warning signal for protection. Although scientists are still uncertain about its use, they do know how the light is created.
The greenish white “fire” contains little infrared or ultraviolet light and is thus known as “cold light.” It is produced in the abdomen of the firefly by almost instantaneous oxidation of a chemical called luciferin, when an enzyme, luciferase, is present.
Luminescence occurs when adenosine triphosphate (ATP) reacts with luciferase, magnesium ion, and luciferin to form a complex (luciferase luciferyl adenylate) and pyrophosphate. This complex reacts with oxygen, producing sufficient energy to convert the complex from a low to a high energy, excited state. The luciferase luciferyl adenylate complex disperses its new energy by radiating a photon of visible light, the flash that we see, and thereafter returns to its original state.
The lighting occurs in cells called photocytes, which are supplied with oxygen by air tubes (tracheae). The nervous system, in combination with the photocytes and tracheal end organs (cells at the ends of the tracheae), controls the rate of flashing.
The excitation stimulus is conveyed by a nerve to the photocytes, through the tracheal end organs, and a chemical mediator is quickly secreted by the nerve to stop the light. Other types of beetles, whose luminescence is long and lingering, apparently do not have these tracheal end organs.
Common fireflies emit a green or bright yellow light, but in Paraguay there exists a 3 inch wingless beetle, known as the railway beetle, that produces red lights at both ends of its body and green lights at different points in between.