where does the energy of a planet go after it gets cooled??

i was just wondering about where does the energy of a planet gets transformed when it is cooling ... as there is no matter in space so the space can not get heated so where does this energy gets transformed to ?? please answer.

The reason it is colder on clear nights than on cloudy night is the heat is reflected off the clouds back to the earth. Without the clouds, the heat keeps going.
I was unable to find if heat was tied in with the aether experiments of the 19th century, when they thought light waves traveled through aether. They were unable to prove its existence, and it is discounted last I remember hearing, so, if it isn't radiated back into space like light, then my second guess would be the air.
I would think the moon gets pretty cold when it gets to be night time, even with no air to dissipate the heat. But then, I've never been on the moon.

i think u may be right abt the cloud part but what about when there are no clouds where is this energy going .... see its a lot of amount of energy so whereever it must be going it should be showing its effect bt currently we can not see any such kinds of observations..

The heat that we feel on earth is from the gases around our planet. When the sun goes down, not shining on the gases, they cool down at a slow rate, because heat is the momentum of the atoms and molecules. As the sun goes away, the molecules slow down, and it gets colder.
In space, you have 2 options when flying close to a star (like our sun). The side that is pointing towards the star, is getting extreme amounts of heat and radiation from the star, without having an atmosphere to easily heat up without getting the lower levels too hot. Because of this, the side pointing towards the sun would get hot (of course, the amount of heat depending on your distance from the star). The side pointing away from the star would get no heat, because it wouldn't be getting warmed up like the atmosphere around us. When away from the star completely, the part that received the energy from the star would cool down, now not receiving any more energy, making less momentum on the molecules. Heat is kinetic energy, while the matter of your ship is potential energy, so the cooling of it would simply be a transfer between kinetic and potential.
For a planet, even one with enough distance from a star to receive no energy from it, would mostly be potential energy on the outside, the molecules moving very slowly, making the level of heat very low. On the inside, however, because of the mass of the planet crushing the insides together, would create kinetic energy from the core. This is why moons like Io around Jupiter has so much volcanic activity, because it's mass, plus the mass of Jupiter pulling on it, transfers the potential energy to kinetic energy, which is enough energy to make these volcanoes erupt.
I hope this answers your question.