When the planet passes in front of its host star, you can measure the change in the stars spectrum, the new chemicals that aren't normally present in a star are assumed to be the planet's.
Telescopes that can do this are still a tiny bit away reality I think.