Ever wonder how an astronomer can declare what the make up is of another planets atmosphere without ever getting a probe to take a sample? This always mystified my because it really doesnt make a whole lot of sense to point a telescope at Neptune and state that the gases of that planet are X, Y, & Z. Well let me unravel that mystery for you.
As you know, light is the only thing that astronomer has to go off of. Radiation actually, but that is what light is. That light comes from the sun, bounces off the distant planet and makes it back here to a telescope. As you know everything absorbs some sunlight and bounces others. Well it turns out that everything has its own "fingerprint" and will absorb some portions of the spectrum and those portions will therefore be missing when that light comes back to the telescope. By analyzing the spectrum from substances here in closed labs we are able to definitively say what gases make up the atmosphere of a distant planet.