This image shows an Einstein ring (middle right), which occurs when a massive object acts like a lens for light coming toward the observer from a background object. This phenomenon is known as gravitational lensing, and recently used for the first time to measure the mass of an individual star.

Stars are enormous balls of hot gas located many trillions of miles away, but when they're observed from the Earth, they appear as tiny shining dots visible in the night sky. In a new study, astronomers made a precise measurement of the mass of a nearby "white dwarf," a star that has reached the end of its life cycle. But how, exactly, can that be done? How do scientists "weigh" the mass of a gaseous sphere light-years away?

"Just about the only way we have as astronomers for measuring masses of stars and planets and galaxies is by their gravitational influence on one another," said Terry Oswalt, a professor of engineering physics at Embry-Riddle Aeronautical University, who wrote a commentary about the recent white-dwarf measurement for the journal Science.

In other words, if a satellite is in orbit around Jupiter, it's possible to estimate Jupiter's mass by measuring the effects of the planet's gravity on the satellite's orbit. [The 18 Biggest Unsolved Mysteries in Physics]

Such estimates can be done with stars as well. Sensitive instruments, such as NASA's Kepler space telescope, can detect planets orbiting stars on the other side of the Milky Way by measuring tiny changes in the velocity of the stars as the planets "tug" on them in their orbits, Oswalt explained. These measurements can also provide researchers with information about the stars' masses.

When two stars orbit each other, as is the case of binary stars, astronomers can measure their motion using the so-called Doppler effect, which relies on the same principle as a police radar gun, according to Oswalt. However, this technique requires the objects to be observable.

"There are several indirect ways you can estimate a star's mass from its [light] spectrum, but they depend upon a detailed model of its atmosphere, which you never know for sure is correct," Oswalt said.

The new technique, described in a study published online June 7 in the journal Science, allows astronomers to assess the masses of stars and other celestial objects, including the inherently dim white dwarfs, black holes and rogue planets (worlds that have been flung from their solar system), all of which are difficult to observe with telescopes.

The study, led by astronomers at the Space Telescope Science Institute in Baltimore, demonstrated how the researchers measured a nearby white dwarf called Stein 2051 B. The technique relies on the influence that gravity exerts on light.

"In his famous equation E =mc^2, Albert Einstein postulated that energy and mass are the same thing," Oswalt said. "Light is a tiny bit of energy and an even tinier equivalent of mass, but it also is affected by gravity." [8 Ways You Can See Einstein's Theory of Relativity in Real Life]

Einstein also predicted that a ray of light from a distant star passing by an object would bend slightly as a result of the gravitational pull of that object. For the effect to be observable, the two objects have to come into a near-perfect alignment, which, Oswalt said, is quite rare.

"As the light from the background star passes by the white dwarf, its direction of a straight line is bent, and that means that the light that we will see seems to be coming from a different direction than the actual star, and that makes the dwarf slowly move across the background star as if the background star made a little loop in the sky," Oswalt explained.

"The basic idea is that the apparent deflection of the background star's position is directly related to the mass and gravity of the white dwarf — and how close the two came to exactly lining up," Oswalt added.

The effect, called gravitational microlensing, was previously observed on a much greater scale during total eclipses or involving objects much farther away than Stein 2051 B. In these distant objects, gravity acts as a magnifying lens that bends the starlight and, as a result, brightens the light's source, according to Oswalt.In the case of very distant galaxies, an effect known as the Einstein ring — a deformation of the light due to gravity — could be observed.

Observations of the near alignments, such as the one that enabled scientists to measure the bending of light caused by the nearby Stein 2051 B white dwarf, are currently rare. But Oswalt said new observatories, such as the European Space Agency's Gaia satellite, will allow astronomers to observe such events much more frequently and thus allow them to map those objects in the universe that have so far been difficult to study.

Original article on Live Science.