It happens every year for just a couple of weeks. Deep in the Congaree National Park, as the sun disappears, the sky will light up as hundreds -- if not thousands -- of male fireflies flash in sync.

The phenomenon, which typically occurs for about two weeks in the South Carolina national park in mid-May or early-June, is a mating ritual for male fireflies competing for the attention of females before their short lives come to an end, Jon Manchester, a park ranger at Congaree National Park, told Fox News.

As the male fireflies, which remain close to the ground, light up together with their flash patterns, the national park looks like “a big Christmas tree with a ton of blinking lights out there on the forest floor,” Manchester said.

It’s more difficult to see the females during this time, Manchester said, as they tend to remain up in the canopy of the trees. Every so often, those watching the fireflies might see one start to travel up toward the trees. That means he’s been selected and “summoned” by a female, Manchester explained.

This great show marks the near end of the fireflies’ lives, Manchester said. Once the lightening bugs reproduce, they will soon die -- as they have “fulfilled their purpose.”

“The beautiful animals do have a really short lifespan, and it serves a purpose to what they do,” Manchester said.

Only specific species of fireflies engage in the synchronous ritual, such as the Photuris frontalis species that reside within the Congaree National Park and the Photinus carolinus fireflies near Elkmont, Tennessee, in the Great Smoky Mountains.

The fireflies in Elkmont, near Gatlinburg, are a part of one of the densest populations of synchronous fireflies, Dana Soehn, a 27-year veteran park ranger in the Great Smoky Mountains National Park, told Fox News.

The fireflies in her region are a little different. The females stay near to the ground, emitting faint flashes of light undetectable to humans, while the males hover several feet ahead.

“What is synchronous is not the individual flashes themselves, but the period of flashing and period of darkness,” Soehn explained. “You have the males flying … that flash for five to eight seconds quickly. All at once, they stop, and it’s pitch black. That lasts another eight to 10 seconds. During that time is when the females are emitting their flash.”

The darkness created by the synchronizing could help the males find the females easier, Soehn said.

So many people hope to see the synchronous fireflies that the Great Smoky Mountains National Park require visitors to make a reservation through a lottery system. This year, she said about 21,000 people registered for the 1,800 passes (which admits six people per pass) available.

The fireflies aren’t particularly active until it’s very dark, around 9:30 p.m., Soehn said. A trolley system can take about 1,000 visitors per night to see the unique display.

“It’s a pretty magical night,” Soehn said.

Soehn predicted the synchronous fireflies in the Great Smoky Mountains will peak with their light show around June 7. Aside from these, there are about 18 other species of fireflies in the region, she said.

Congaree National Park has designated a specific trail for those who hope to see the unique ritual. Onlookers can traverse the quarter mile trail lit with red lights to observe the occurrence. However, once in the designated area, the park will provide a blue filter for peoples’ flashlights so as not to disturb the fireflies.

While less visited than the Great Smoky Mountains National Park, thousands of people headed to the Congaree National Park to observe the fireflies last weekend, Manchester said.

Besides South Carolina and Tennessee, synchronous fireflies can also be spotted in the U.S. this summer in the Allegheny National Forest in Pennsylvania.