Why is everything floating in space so cold? Of course there is pretty hot stuff too. For example Suns.
But isn't the vacuum of space the perfect containment for heat? And shouldn't the rare collision with particles even heat up an object that floats around in space?
Why aren't they hot from time to time? Is it because they loose their heat by radiant heat?
And if so does radiant heat emission always occur until the object is the same temperature as the surrounding or does it depend on other factors? 
 A: Well, the basic law of thermodynamics tells you that the heat flows from the hotter object to the colder one. But what this means in a given situation will depend on the precise mechanism of that heat flow, i.e. elementary interaction that makes it possible.
So let's discuss few of them and see where it takes us.


*

*First, there's the usual conductive heat transfer. This is mediated by the collisions of the touching materials (and even more macroscopically by an electromagnetic force. Obviously, this effect is irrelevant in the vacuum.

*Second, there's evaporation. Even if you have a perfect crystal that is very stable, there's a possibility that a large fluctuation will occur and one of its molecules will be "kicked out" of it and set flying into the empty space. Because the molecule needs to have a (lot) higher energy than the rest of the molecules around it to be able to get free from the crystal, the average remaining energy and therefore also the temperature will decrease. But this effect is more relevant for non-crystals (because the molecules are much less tightly bound). E.g. if water were put into the free space it would freeze by evaporation very quickly.

*Last, but not least, radiation. Any object at non-zero temperature will have lots of its constituents in excited energy states and there will be a non-zero probability for returning to a lower energy state and emission of a photon. In more simple terms, kinetic energy is converted to an electromagnetic energy. This effect is most relevant for black objects which absorb all the radiation (an ideal form of which is called black body) and least relevant for white objects which reflect everything (note that the terms black and white are to be considered here in generalized sense, not just pertaining to visible light).
Well, these effects are most important for the usual matter. But there is also the dark matter which doesn't interact electromagnetically (therefore the name), so it wouldn't cool by photonic radiation (but might cool by emission of other particles with which it interacts). In conclusion, the heat transfer depends very much on the precise microscopic interaction that the given object is able to undergo.
A: Anything in space is at the same temperature as the blackbody temperature of radiation it is immersed in, or an integration of the blackbody radiation per sterradian angle.  If that is a close orbit around the sun the temperature is hot.  The temperature in intergalactic space is 2.7K.
A: What is everything? If it is a cosmic ray or the solar wind, it is very hot. The coldest
it can get is 2.72 K because that is the temperature of the cosmic background radiation, and if there were no other sources of radiation, the object would come into equilibrium with this. In practice, there is always some form of other energy streaming through space. So the answer depends on which neighborhood you are hanging in.
A: Actually space is the perfect environment for making things cold. The night sky is cold enough that people in the desert can leave trays of water out and find them frozen in the morning, even though the night-time air temperature never dropped to freezing.
What happened is that the trays radiated their heat off into space. Of course space radiated heat back to the tray, but the stars are so far between and far away that the amount of heat that gets here is very small.
This doesn't apply during the daytime. In short, things in space get hot if they're in sunlight, and they cool down otherwise.
A: When a gas expands, it cools.  It turns out that the universe has expanded very significantly since the Big Bang, meaning that it is now very cool.  If any gas is to be placed in the vacuum of the universe, then, absent something like gravity to hold it together, it will expand and thereby cool to the temperature of the medium around it.  
