This glowing worm is the larvae of a species of
click beetles, which belong to the family
Eliteredae. Click beetles typically make a clicking motion to quickly escape predators. Of the 10,000 beetles identified, only 200 are
bioluminescent. It is hypothesized that the beetle larvae glow green to lure prey such as ants and stick insets. When presented with these insects, the worms readily devoured them. While most beetles dine on flowers and other plant-matter, their larvae are mostly predatory. The insects wait with jaws open, and as soon as an ant or a termite flies in, their jaws clamp shut.
Source: http://www.livescience.com/48790-photos-peruvian-glow-worm.html