Lightning bugs or fireflies are neither bugs nor flies;
they are actually beetles, which have two pairs of wings.
According to Wikipedia: “Fireflies hibernate or overwinter during the larval stage, some species for several years. Some do this by burrowing underground, while others find places on or under the bark of trees. They emerge in the spring. After several weeks of feeding, they pupate for 1 to 2.5 weeks and emerge as adults.” (1)
You might see more than one type of firefly in your yard. There are several species of fireflies in Michigan. Photinus is the most common firefly in our area. Each is about one half inch in length, and it produces a yellow-green flash. In the dark, you may be able to tell them apart by the color of their flash or distinctive flash patterns.
Firefly Watch also explains: "There are a few different ways to determine the sex of a firefly. The simplest way is to observe whether they are flashing while flying or while resting on vegetation. Typically, the males flash in flight while they are patrolling an area for females. The females observe from their perch and, if interested, they return the males' flashes."(2)
1. Firefly - Wikipedia, the free encyclopedia - http://en.wikipedia.org/wiki/Firefly
2. Firefly Watch - https://www.mos.org/fireflywatch/types_of_fireflies