“I have obtained one of the finest and least expected results—Spectra of the stars!—and beautiful spectra with colors and magnificent lines. Just one more step and the chemical composition of the universe will be revealed,” wrote astrophysicist Pierre Jules César Janssen to his wife from an observatory in Italy in December 1862. Armed with the latest technology of the day and observations made by other Western astrophysicists, Janssen was determined to pry open the secrets of the galaxy.

On August 18, 1868, Janssen managed to do just that. He became the first person to observe helium, an element never before seen on Earth, in the solar spectrum. At the time, though, Janssen didn’t know what he’d seen—just that it was something new.

The mid-1800s was an exciting time to peer at the heavens. A new instrument called a spectroscope was upending the field of astronomy. Similar in design to a telescope, the spectroscope worked like a super-powered prism, dispersing light into measurable wavelengths. An early model had allowed physicist Joseph Fraunhofer to observe the sun in the early 1800s, but he was puzzled by black lines interrupting the normal colors. These black lines were named for Fraunhofer, even though he didn’t understand what they were.

That knowledge would come several decades later, with German researchers Gustav Kirchhoff and Robert Bunsen. In 1859, Bunsen and Kirchoff discovered that heating different elements produced bright lines of light in the spectroscope—and those lines of light sometimes corresponded to the dark Fraunhofer lines.

The scientists determined that the bright lines appeared when a hot gas was burned. For example, hydrogen burns orange, but when observed through a spectroscope, it becomes clear that the orange is made up of multiple individual narrow wavelengths of light. Similarly, the dark lines that Fraunhofer had discovered represented light being absorbed by a cooler element at the surface of the sun. “The two scientists found that every chemical element produces a unique spectrum,” the American Institute of Physics writes. “This provides a sort of ‘fingerprint’ which can confirm the presence of that chemical.”

By analyzing the emission spectra of specific elements in the lab, then turning their spectroscopes on the stars, researchers could make out the chemical composition of everything from our sun to the stars across the galaxy.

“Before the spectroscope you had no idea what the sun was made of, or what stars are made of,” says Deborah Warner, a curator in the division of medicine and science at the National Museum of American History. “All of a sudden there’s this almost magical technique by which you can know the elements of these distant bodies. New elements are showing up right and left because you have this new tool.”

Janssen dove eagerly into this new form of light analysis. Though he lived in Paris, he traveled across Europe and Asia in search of optimal vantage points for observing the night sky. He also chased after eclipses, visiting Italy in February 1867 and then going all the way to Guntur, India, for the total solar eclipse of August 18, 1868. The French government and its national Academy of Sciences both funded this expedition, along with that of another Frenchman, spending more than 75,000 francs for the two journeys.

But the high cost would prove a worthy investment. On the day of the eclipse, armed with his spectroscope, Janssen saw something extraordinary: a bright yellow line whose wavelength didn’t match with any known element. The spectrum came closest to the pattern made by sodium, but was distinct enough to merit its own category. It seemed that Janssen had discovered a new element, one never before seen on Earth.

At the same time, Janssen uncovered a new way of observing the sun without the need of an eclipse, using a modified scope. He sent word of all this to the Academy of Sciences after the eclipse. But around the same time, the Academy received word from English astronomer Norman Lockyer that he’d happened upon an invention that allowed him to view the sun without the eclipse, and had made a similar observation. With each man’s work confirming the other’s, it was hard to award definitive credit to either. Astronomer Hervé Faye suggested something of a compromise: “Instead of trying to proportion the merit of the discovery, and consequently diminishing it, would it be better to attribute impartially the whole honor to both of these men of science, who, separated by some thousands of miles, have each been fortunate enough to reach the intangible and invisible by a method which is probably the most astonishing that the genius of observation has ever conceived?”

The two researchers heartily agreed to share the honor of discovery, and later became close friends. But even with the excitement of their observation, questions remained. Most important among them: What exactly had Janssen and Lockyer seen? Not all scientists believed the observation, as Lockyer was soon to learn. Seeking proof to back up the claim that he’d helped discover a new element, Lockyer went to English chemist Edward Frankland to attempt to reproduce the wavelength pattern in the lab. Frankland theorized it might be caused by hydrogen under extreme temperature and pressure, but they were unsuccessful in their attempts to recreate it.

The skepticism over the possibility of an element existing in space but not on Earth is perhaps no surprise, given that it was the first of its kind. Science historians James L. Marshall and Virginia R. Marshall write, “Frankland, perhaps cautious because of the many erroneous ‘newly discovered elements’ arising from the high resolution spectra now available, maintained that he did not want to have his name associated with this imaginary element,” even after Lockyer went public, dubbing it “Helium,” after the Greek name for the sun.

Not everyone was so skeptical. American scientist John William Draper extolled the discovery in 1876 in an address to the inaugural meeting of the American Chemical Society. “I often look at the bright yellow ray emitted from the chromosphere of the sun, by that unknown element, helium, as the astronomers have ventured to call it. It seems trembling with excitement to tell its story, and how many unseen companions it has,” Draper said.

It wasn’t until 1882 that a physicist spotted helium on Earth. Italian physicist Luigi Palmieri recorded the yellow spectral line in his data while analyzing lava from Mount Vesuvius. That discovery was later followed up by experiments conducted on the gas by Scottish chemist William Ramsay, and by 1895 researchers could definitively say that helium existed on Earth as well as in the sun. Ramsay went on to show helium was a product of the radioactive decay of radium, and placed it in relation to other elements on the periodic table.

Today, helium is probably best known today as the gas that fills birthday balloons, but the gas also serves important purposes in medical machinery (like MRI scanners) as well as in spacecraft and radiation monitors. It’s also used in computer parts, microscopes, air bags in cars, and the large hadron collider used in physics experiments. Plenty have worried about shortages of the element, but a large deposit found in Tanzania means we’re likely well-supplied for some time.

As for Janssen, he hardly rested on his laurels after spotting helium in the sun. Over the course of his long scientific career, he traveled to Peru, Switzerland, Japan, Algeria and elsewhere in his search to understand the cosmos. He even escaped Paris in a hot-air balloon in 1870, when the city was under siege during the Franco-Prussian War. He fervently believed in his work, once writing, “The study of light will show us the physical organization of the system of the world.”

Editor's note, 9/4/18: A previous version of this article stated Lockyer and Janssen shared credit for the discovery of helium. This was inaccurate, since the element had yet to be recognized. They shared credit for discovering a new way of observing the sun without an eclipse. The article has been modified to reflect this.