Facts on fireflies

How do fireflies produce light?

The fireflies' light comes from a chemical reaction that takes place in special cells in their abdomen, called "photocytes." ("Photocytes" means "light cells." ) The photocytes contain two chemicals that are essential to making light, luciferin and luciferase. "The chemicals are named after Lucifer, the fallen angel of light"
When the firefly pushes oxygen into the photocytes, the oxygen, luciferin and luciferase combine with two other chemicals, magnesium and Atp. (ATP is short for adenosine triphosphate, but everyone, even scientists, calls it ATP.) ATP is a compound that all living plants and animals use as energy in their cells; your body turns most of the food you eat into ATP. When luciferin is combined with ATP, or the fuel, and oxygen, which adds even more fuel, the luciferin is transformed into a very-high-energy chemical. It's unstable in its high-energy form, however, and as it reverts to its normal state it gives off energy in the form of light. Scientists call this process "bioluminescence" because it's the production of light (luminescence) by a biological process.
Because the chemical luciferin reacts in such a noticeable way to ATP, some scientists use it to detect bacteria, which also use ATP. By using luciferin in blood or urine samples, or in foods such as milk or orange juice, scientist can determine how many bacteria are in the sample by the amount of light that it gives off. NASA is using it to detect living organisms on other planets.
So, why do fireflies give off light?The ones that are flying around are the males, and the females sit in the brush and respond by flashing their lights. This is how they find each other."
Another reason for the light is that it tells birds and other insects that fireflies aren't a good meal. Like the orange color of a monarch butterfly, or the yellow stripes on a wasp, the light on the end of a firefly lets predators know to avoid eating them.
A third reason why fireflies light up is to warn other fireflies of danger. Distressed insects almost always attract insects of the same species. If fireflies are caught in a spider web they will begin distress flashing to warn others. They'll do the same thing if they are caught and put in a jar."
The distress signal doesn't always have the desired outcome. There is a species of firefly that is a predator, called the femme fatale, because the female also eats her mate. The predator firefly has other tricks. She can mimic the flash of other species of fireflies, and when a male responds and comes toward her to mate, she eats him instead.
Different species even have different colors of light. For example, the genus Photinus have a yellow flash, Photuris have a green flash, and Pyractomena have an amber flash.
In most species of fireflies, during a certain time of night, males fly about flashing their species specific flash pattern. Females of the same species tend to be perched on vegetation, usually near the ground, and if a flashing male catches a female's fancy, she will respond at a fixed time delay after the last male's flash. A short flash dialogue may ensue between the male and female as the male locates her position and descends to mate. The flash patterns of fireflies seem to show many variations of type of communication system
Aspects of male flash patterns are also thought to be affected by sexual selection. Female fireflies have been shown to prefer certain characteristics of a male's photic signal (such as increased flash rate) and respond preferentially to males that possess these "sexy" signal components.

Syncro fireflies in Kuala Selangor
It is the folded-wing fireflies (Pteroptyx sp.) which have developed this striking synchronous flash pattern. The species Pteroptyx tener occurs along tidal reaches of the Selangor river. They may be found singly or in groups ranging in size from a dozen or so, to tree-loads of thousands in estuarine mangrove swamps.
The same trees may be used over a long period (recorded up to 5 years), and riverman in Malaysia are said to use firefly trees as navigation marks.A few fireflies remain in the display tree by day, but at the Selangor river, most leave the tree at dawn and are found in grass blades and other foliage until one hour before dusk. Flashing begins one hour after sunset at the rate of 3 flashes per second. It takes 15-20 minutes for flashing to build up from onset to peak. Only the male flash in synchrony. The display is most briliant during a period of 2-3 hours after onset, but flashing continues at low levels until half hour after sunrise. Individuals synchronise by adjusting to previously observed flashing of neighbours, and newcomers quickly develop the synchrony of the tree. Trees which are close together may flash in time.
Males take up flashing stations on leaf edges or leaf points within trees and probably defend the surrounding leaf area. Because the males are spread out, they give the impression of artificial tree lights. They aim their lanterns (to attract females and repel male?) by bending the abdomen downwards; and with the tip nearly touching the leaf, their light is directed forward and laterally. Males may enter into a brief flash dialogue with flying and glowing females. Or they may chase after females, both sexes twinkling in flight. Long distance unidirectional flights are made by females possibly seeking sites to lay eggs. On these flights, the fireflies flash about once every 3 seconds.

Why synchrony?
The flash rhythm is species specific and probably attracts females to males from long distances. Further explanation is still controversial. One authority suggests that synchrony within small groups is groups is important, as it attracts more females to the group and therefore to each of the component males. The problem with this explaination is that there is no evidence to suggest that fireflies in display trees make up small groups. The theory also fails to explain why distant groups within the same tree flash together.
Another authority points out that male fireflies probably compete for females by increasing the brightness of their flashes. They suggest that males must flash together in order to let females compare the different flash intensities. Just after a flash, females are less responsive, so a late flash is seen as a dim flash. The problem with this theory is that a clever male firefly which flashed just before everyone else would be seen as brighter by a passing female, and should therefore be chosen.
Scientist are clearly having headaches trying to explain why fireflies flash together.