The Chinese thought these twinkling little creatures came from burning grass. A European legend warned that if a lightning bug flew in the window, someone was going to die. Aztecs used the term firefly metaphorically, meaning a spark of knowledge in a world of ignorance or darkness. American Indians collected lightning bugs and smeared them as decorations on their faces and chest.
The taillight contains two rare chemicals, luciferin and luciferase. Luciferin, a heat resistant substrate, is the source of light; luciferase, an enzyme, is the trigger; and oxygen is the fuel. A body chemical, ATP (adenosine triphosphate), converts to energy and causes the luciferin-luciferase mixture to light up (edit: turning the ATP to ADP). Small internal injections of ATP in the firefly tail cause flashes of light that can be measured quantitatively. If you will notice, the firefly turns on its light when flying upward, at intervals of about 5.8 seconds. In the dark periods it coasts downward again. You may also have noticed that hundreds of them synchronize their flashes to appear simultaneously.
The ability of these insects to produce cold light (bioluminescence) has led to new flashlights and flares on the market today. Special electronic detectors, using firefly chemicals, have been placed in spacecraft to look for earth-life forms in outer space. When as little as one quadrillionth of a gram of ATP enters the rocket's detector, a flash of cold light is given off and the signal is recorded by scientists on earth. Other detectors warn that milk, food or water may be bacteria contaminated.