Bioluminescence refers to visible (to humans) light-emission by living organisms, by means of chemical interactions. Some organisms generate light themselves, while others have mutualistic relationships with those that do. (The word is sometimes used in a much broader sense, including other kinds of light-emission such as fluorescence, phosphorescence, and UV light, but that’s another story).
Bioluminescence has evolved many times, in many different lineages; one estimate is that it arose at least ninety times independently. It’s a very useful thing, involved in many different functions, including mate-attraction, prey attraction, concealment, warning, and group coordination.
Here is a very small sampling of the varied functions in a wild diversity of organisms.
Mate attraction and courtship initiation: Nocturnal fireflies use self-generated light to attract mates. Males flash their lights in particular patterns, allowing females to identify their own species, and females flash back after a suitable delay. If they liked what they saw, courtship ensues. In the Caribbean Sea, tiny crustaceans called ostracods produce bioluminescent mucus as a mate attractant; on dark nights, the males swim in species-specific patterns trailing streams of the flashing mucus. Some sharks have species-specific patterns of lights, useful for species identification in the dark sea; some have illuminated claspers on the males, which would also allow sex-identification at some small distance.
Prey attraction and hunting: Some fireflies use their light to attract prey. Females of Photuris fireflies lure in males of Photinus fireflies by flashing the pattern characteristic of the males’ species; the females obtain a meal and protective chemicals from their prey. Deep-sea anglerfish females somehow acquire mutualistic luminescent bacteria and house them in bulbs at the end of a long modified dorsal fin extending from the forehead, luring prey toward the huge mouth (males are small and parasitic, stuck to the female’s side). The famous glowworms found in some New Zealand caves are the larvae of certain fungus gnats; they hang from the cave ceiling on long, sticky threads that capture prey drawn to the glow. Flashlight fish have a big light organ that houses bioluminescent bacteria just beneath the eye; it is used to attract plankton (but has other functions too). Some deep-sea black dragonfish are thought to use suborbital light organs in hunting, shining a very unusual red light that is not visible to most prey species but allowing the fish to see their prey.
Concealment: The little Hawaiian bob-tailed squid houses mutualistic luminous bacteria in its mantle cavity. The light serves as a form of protective counter-shading, making the underside about as light as the upper side, obliterating the animal’s shadow, and thus obscuring its shape. Some fishes may also counter-illuminate too, with luminescent organs along the side of the body. Interestingly, some midshipman fish can only do this if they eat luminescent invertebrates (such as ostracods) to obtain an essential chemical. Some sharks are counter-illuminated, perhaps helping to conceal them from potential prey; in some cases, sharks can vary the amount of luminosity in accordance with their depth in the water and the amount of light coming from above.
Defense: Vampire squid live at great depths in the ocean; they produce clouds of luminescent mucus when they perceive a threat, perhaps to deter predators. Many species of marine ostracods use bioluminescent flashes in extruded mucus to startle or distract would-be predators. Some lantern-fishes are called stern-chasers, for the luminescent patches near the tail that appear to flash on and off as the tail moves back and forth. That may startle and confuse an approaching predator. Flashlight fish can blink their light, making the fish alternately quite visible and less visible, perhaps confusing predators.
Group coordination: Self-generated light-emission occurs in lots of bacteria. Many are free-living, especially in sea water, but also on land and in fresh water. Bacterial cells, both free-living and parasitic, are able to communicate with each other with their light signals in a complicated way (by turning certain genes on or off) called “quorum-sensing,” which regulates cell density. This apparently allows the bacterial colony to somehow coordinate sporulation, virulence, biofilm production, and light production itself.
Of course, there are still many unknowns. There are light-emitting millipedes, earthworms, snails, sea stars and sea cucumbers, fungi, and algae that generate their own light; the functions are seldom well studied. New World glowworms are beetles that live in soil and leaf litter; the females and larvae emit light. How do they use it? There’s a terrestrial snail in southeast Asia with luminescent eggs and a bioluminescent freshwater snail in New Zealand. Mysteriously, a terrestrial nematode (round worm) keeps luminous bacteria in its gut, where they are reported to do various things not related to light production. So there is always the possibility that, in some cases, luminosity is not functional itself but rather a by-product of other genetic traits that do have a useful function, favored by natural selection.