The so-ugly-it’s-kinda-cute-till-it-eats-your-tomatoes hornworm. (bigstock)

Creatures that glow in the dark might be scary in the movies, but when you come upon them in real life, they’re a treat. Think of fireflies winking at the edge of the lawn on a summer night, or the waves of light you stir up while swimming among phosphorescent plankton in the sea.

My favorite bioluminescent encounter was while making my way along a dark woodland road without a flashlight, when I spotted strange glowing patches among the trees. Something out of the Brothers Grimm? No, just foxfire, the light emitted by patches of luminous lichen on decaying tree bark. (By my guess, the name is a version of “folks’ fire,” as in fairies or “the little folk.”)

But here’s a new twist. The luminosity of some life forms appears to us only when light is altered in some way. I recently learned that tomato hornworms will glow if you shine a black light on them. Some of you might remember the black light as a gadget used to illuminate psychedelic artwork in the ’60s, by narrowing the light spectrum to the UV (ultraviolet) range. But it has broader uses in police work, including the identification of counterfeit money, which lacks a certain ultraviolet mark, and in medicine, for spotting and delineating certain pathogens that are visible in such light.

What’s interesting about the nighttime detection of the hornworm is that it’s extremely hard to see by day. This fat, four-inch-long caterpillar should be easy to find, but it has spent millennia learning how to resemble tomato stems and leaves. You don’t know it’s there until its plant-chomping damage is done. But armed with a black light, you can easily stalk your prey as it glows with a greenish color among the tomato vines.

Bioluminescence is sometimes used by animals to frighten off a predator, which in this case is you. But be not unnerved. If you’re repelled by plucking huge, slightly squishy, neon-lighted worms off plants with your fingers, use tongs. But do it gently, because you have an important decision to make before you stomp on them or drop them into soapy water to end their lives. Collect them, then examine them indoors under normal light, and if you see small, white objects, like grains of rice, lined up along a hornworm’s sides, put that one safely back in the garden. The white things are the pupating larvae of a braconid wasp, which are parasitizing the hornworm and will soon destroy it from within. Their offspring will do the same to other worms.

It’s also possible that you will fall in love with this odd creature and not be able to destroy any of its kind. In that case, just encourage beneficial insects such as lady beetles and lacewings to patrol your garden, by keeping the yard poison-free. These and other insects prey on hornworm larvae before they grow to monstrous size.

A black light that emits only UV light can be found online for about $7. After tomato season, you might find other ways to put it to use. For example, you can shine it around your kitchen sink and counters, in the dark, and locate any E. coli bacteria present.

Now that’s scary.

Damrosch’s latest book is “The Four Season Farm Gardener’s Cookbook.”

Tip of the week

Ripening ears of corn are magnets for squirrels, raccoons and other four-legged pests: Wrap the fattening ear in aluminum foil to discourage rodent snacking. Ears are ready when the silks begin to brown and the kernels are full and milky when pierced with a thumbnail.

— Adrian Higgins