Pick a known exoplanet orbiting a star in the night sky. Call it “Planet Fred.” With the equipment we have on the ground and in space, and with our current technology, can we conclusively say that Planet Fred over here is composed of [mineral] with an atmosphere of [gas], and Planet Wilma over there is composed of [another mineral] with an atmosphere of [another gas]? Or is it all just educated guesswork?
Spectroscopy. Molecules absorb and emit EM radiation at characteristic wavelengths. And spectroscopy can measure a lot more than just composition.
Spectroscopic analysis of a planet is more subtle than for a star, but it still provides powerful evidence.
JPL’s “FINESSE” Fast Infrared Exoplanet Spectroscopy Survey Explorer:
It depends on how we discovered the planet, and how we’ve subsequently observed it. There are two main ways that exoplanets are discovered: By them causing their star to wobble slightly as they orbit around it, and by them passing in front of their star and thereby slightly dimming the star’s light. The latter method only works for about 1% of planets, since it depends on the planet and star lining up just right, but it’s better in most other ways, because it can detect any kind of planet, and we can make good estimates of what proportion of planets we’re detecting. The former method, by contrast, can only detect very large planets very close to their star, and says nothing about how many planets there are smaller or further away.
Ideally, of course, you’d have both kinds of of observations. And in principle, you can detect the light coming from the planet itself directly, though this requires insane resolution to be able to pick it out next to its much brighter star. I don’t think anyone has actually pulled that off yet, but there are space telescope designs that would be able to do it.
Each kind of observation tells you different information. With direct imaging, you could determine the planet’s atmospheric composition from its spectrum, as well as the planet’s size and distance from its star. With the planet passing in front of its star, you can determine the same things, as well as how thick the atmosphere is. With the wobble method, you can determine the planet’s mass.
The composition of the atmosphere, we can be fairly confident about: Spectroscopy is a mature and well-established science. For the composition of the solid part, it’s a matter of extrapolating from the size (and, ideally, density), based on what we know about other planets, and there’s considerably more uncertainty there.