In the lonely, cold and desolate universe beyond the Earth’s atmosphere, some stars are perpetually in motion dancing with one another. In a report released late last week, NASA explained the science behind the dancing celestial bodies that the space agency’s Kepler space telescope has been documenting over the past several years.

The stars, colloquially known as “heartbeat stars,” have a varying brightness that, if mapped as a line graph, would look similar to an electrocardiogram used to monitor the heartbeat of patients in a hospital.

Their brightness is impacted by the stars’ distance between one another. As they move along elliptical orbits, the changing gravitational pull causes them to have short bursts of brightness. Just like with the tidal force between the Earth and the moon, when the bodies get close to they stretch toward one another. That variable gravitational pull changes the diameters of the stars rapidly.

“You can think about the stars as bells, and once every orbital revolution, when the stars reach their closest approach, it's as if they hit each other with a hammer,” Avi Shporer, a NASA Sagan postdoctoral fellow at NASA’s Jet Propulsion Laboratory in Pasadena, California, and lead author of the study on heartbeat stars, said in a statement Friday. “One or both stars vibrate throughout their orbits, and when they get nearer to each other, it’s as though they are ringing very loudly.”

The Kepler space telescope was launched in 2009 and has been studying heartbeat stars since at least 2011, when a study about a star called KOI-54 was released showing that it increased in brightness every 41.8 days. The most recent study looked at 19 heartbeat star systems, trying to determine the speed of the objects as they orbit one another. It is the largest study of heartbeat systems to date.

“We found that the heartbeat stars in our sample tend to be hotter than the sun and bigger than the sun," Shporer said. “But it is possible that there are others with different temperature ranges that we did not yet measure.”

The Kepler telescope’s main mission is to search for and detect distant planets.