How can scientists measure chemical composition on other planets?
Scientists can measure the chemical composition of the atmosphere of other planets using spectroscopy.  Each molecule in the atmosphere absorbs and re-radiates at specific frequencies of light that are a function of temperature and unique to the specific type of molecule.  For more information see https://en.wikipedia.org/wiki/Extraterrestrial_atmosphere and http://www.physics.uu.se/research/astronomy-and-space-physics/research/planets/exoplanet-atmospheres/ .