Via Flick: T. Kiya; Creative Commons 2.0 Generic Attribution License

Just as birds have specific songs and calls, each firefly species has a specific flashing pattern. In fact, identifying a flashing pattern is the easiest way to identify a species. That pattern is similar to a bird song and helps males locate a mate.

Males usually fly through the air signaling (so all the flying fireflies you see are male), and females signal back from the ground or vegetation.