spectra of planets



I can understand how spectroscopy is used to analyze a star's make
up...absorption lines and such. However, how can we analyze a planet
or moon's constituents when the light we observe is reflected, not
emitted? If all the plantets and moons in our solar system shine only
with reflected light, why aren't the specta each the same as the
sun's? Are the sun's spectral lines somehow compensated for?
.