Most Americans will see some fireworks on July 4, but some animals produce light shows with their bodies all year. These living fireworks light up the night. But how, and why?

Railroad Worms

These beetles are named for the lights that run down the female’s larva-like body, said to look like lights from train windows at night.

The female’s juvenile-looking form may let her “maintain a bigger store of eggs in a more stable ecosystem, where wings to disperse to another location are not needed,” says Paul Marek, an entomologist at the University of Virginia. Males look more like beetles with fancy “moth antennae and fly wings.”

Only adult female railroad worms and larvae glow. Like many bioluminescent animals their light is created by a reaction between the light-emitting molecule luciferin and the enzyme luciferase.

The greenish-yellow lights on her body, which she can control, warn predators that she’s toxic.

Some Brazilian species also have a red “headlamp.” Insects typically can’t see red, Marek says, but it’s thought that the railroad worm can. A red headlamp allows her to see and surprise prey insects who can’t see her.

Blue Ghost Fireflies

Blue ghost fireflies also have females that resemble larvae, Marek says, only in these insects the light is about mating.

These insects are native to the Appalachian forests of the U.S. and range as far west as Texas. emit a greenish glow. To find females, males fly slowly through the forest broadcasting their light, while females also glow and may emit pheromones.

Lantern Sharks

These tiny sharks leave deep underwater in total or near-darkness, but they supply their own illumination.

At just six inches long the and the are the world’s smallest shark species, found on the northern coasts of Venezuela and Colombia.

George Burgess of the Florida Museum of Natural History, who described both species, says their photophores, light-producing organs, are mainly located around their reproductive organs.

Males and females are “strutting their stuff, showing where their stuff is,” Burgess says. Each species has a specific light pattern, “like a name tag,” so they can find mates in the dark ocean depths.

Velvet belly lantern sharks seldom get over 18 inches long but the light-emitting photophores on their bellies camouflage them so they fade from view against illumination from above. (Related: Sharks Warn Off Predators By Wielding Light Sabers)

Hawaiian Bobtail Squid

These cuties light up via bioluminescent bacteria living in a light organ in their mantle, or main body. When they hatch they pull the bacteria in from sea water as they breathe. Then they trap it in mucus around the light organ, where they multiply.

View Images A bobtail squid (Euprymna scolopes) at the Monterey Bay Aquarium. Photograph by Joel Sartore, National Geographic Photo Ark

Hawaiian bobtail squid sleep under the sand all day, coming out to forage at night. The light camouflages them against moonlight on the surface and eliminates their shadow, obscuring them from predators.

Comb Jellies

Comb jellies aren’t jellyfish, but a separate group called ctenophores which don’t have numerous tentacles or pack a sting. (See video: What Are Comb Jellies and Why Is Their Poop Important?)

View Images A comb jelly (phylum Ctenophora) exhibits bioluminescence. Photograph by Hiroya Minakuchi, Minden Pictures/Nat Geo Image Collection

Some species like the Leidys comb jelly have photophores inside the bell, or main body, Burgess says. All are propelled through the water by columns of cilia which refract light, producing a shimmering rainbow to rival any fireworks display.