What is more magical than fireflies on a summer night? Those of us who grew up playing outside long after dusk remember fireflies or lightening bugs as an essential element of the fun.

Fireflies, also known as lightening bugs and in some circles glow worms, are a type of beetle able to make light with specialized cells in their bodies. The process, called bioluminescence, is shared by many other organisms, many of them living in the sea. The cells that make the light contain a chemical called luciferin. (You do remember that a type of match was once called “lucifers” and the term came to be commonly used to name any kind of fire-starter.) The word lucifer comes from the Latin meaning “light-bringer,” and that is just what these chemicals do.

Fireflies make a bright light that gives off almost no heat. The chemical reaction converts almost all of the energy produced into light.

There are an estimated 170-plus species of fireflies in North American and more than 2,000 species world-wide. Amazingly, each species has its own “language.” Fireflies use their luminescent abdomen to signal to other fireflies: “Hello baby! Here I am, the bug of your dreams!”

The tricky part is that they only want to attract mates of their own species, so each species has its particular distinctive visual Morse code to signal possible mates. Those flashes of light we see in our gardens are really superfast rhythmic patterns designed to promote bug love.

There are two groups of fireflies in the U.S. that have been identified as being able to synchronize their flashes. For some unknown reason, from time to time, all the males of those species flash in unison. The synchronous flashing will go on for a while, then suddenly stop followed by a longer period of darkness.

In the past few years, the numbers of fireflies has decreased worldwide. We see fewer of these luminescent creatures today as a result of loss of habitat, reckless use of pesticide and light pollution in cities. The firefly larvae thrive in rotting wood, forest litter and in the mucky edges of streams and ponds. Their environment of choice is warm, humid and near standing water of some kind.

The result of widespread development shrinks areas where the larvae can happily live. Too much light at night seems to interfere with the adults’ ability to locate and communicate with each other and procreate. Of course, widespread use of pesticide just kills them. While some are still out there, you can encourage them to come into your garden. Here are some simple steps you can take to bring them in.

1. Stop using pesticide. You should do that anyway regardless of whether you want fireflies or not. Pesticides kill all sorts of beneficial insects that control pests in your garden, pollinate your plants and generally make the world a better place. Broad-spectrum pesticides are the worst. They will kill anything and everything.

2. Go easy on the Sluggo. Firefly larvae's main food source consists of slugs, snails, grubs and worms. So instead of trying to wipe out these critters yourself, let the fireflies do it for you. You'll be happy and so will they.

3. Give them cover. Fireflies are nocturnal creatures, so they need a place to hide during the day. Tall grass, low-growing plants and shrubs all provide their favorite places to loll during the daytime. Allow some room for wildness on your property where the larvae and adults can take cover and find sustenance.

4. Make a little bog. Although fireflies are not extremely picky about location, they like a spot of moisture here and there. Adding a water feature to your yard helps as does leaving some logs lying to rot and make a home for larvae. Pond edges, low spots where water collects, and other moist areas are attractive to them and to their prey.

5. Plant some flowers. Adult fireflies eat pollen and nectar of a variety of flowering plants. Plant several kinds to flowers to increase the odds of your local fireflies finding them tasty and appealing. In planting these flowers you'll also attract other pollinators that will work hard for you in the garden.

6. Turn off the lights. Not only are fireflies harder to see when there are bright lights, the bugs themselves are confused by conflicting light. They use their self-generated lights to navigate and move around as well as communicate with each other. Whether or not you are sitting out in the evening, turn off the porch light, garden lights and others to make the show more enjoyable for you and the bugs. Remember to close your blinds or curtains at night as well, so the light won’t spill from the house into the yard.

7. Leave the jar in the kitchen. Although most of us have put lightening bugs in fruit jars, it really isn't good for them. They are often dead by the time they get out of the jar, and simply handling them can be harmful to them. The life-span of an adult firefly is generally around 21 days, so don't shorten an already short time.

8. Encourage your neighbors to do the same. If you live in a neighborhood with people close by, talk to your neighbors about the joys and sorrows of fireflies. Encourage them to help you increase the firefly population in your street.

Research is just beginning on how and why fireflies behave as they do. They are fascinating creatures and deserve our help in their struggle to survive.

Judy Barrett is the author of books on gardening focusing on herbs, heirlooms, roses, recipes and more. The latest is Easy Edibles. Visit her on Facebook at Judy Barrett’s Homegrown.