Starlight complicates things by keeping space from dropping to the temperature of the cosmic microwave background radiation that fills the universe. That temperature, about 3 kelvins (just above absolute zero), is the coldest anything can get without the aid of an outside process.
In a typical galaxy, you can have molecular clouds at 10 K, where dust shields them from stellar radiation; warmer clouds at around 100 K that are heated by starlight and high-energy particles called cosmic rays; gases near hot stars at 10,000 K; and the gases resulting from supernovae that start out at 100 million K. The supernova gases cool relatively quickly in astronomical terms (thousands of years), but the ongoing heating processes keep the other objects at nearly the same temperatures. — Stephen Reynolds, North Carolina State University, Raleigh
If space is only a few degrees above absolute zero, how can hot nebulae gases from exploded stars stay warm for a long time?
William Nopper, Rochester, New York
What we think of as “heat” is the random motions of particles (or light photons). Transferring heat from one place to another takes time; how long depends on the density of the materials. Interstellar gases have low densities. If there were enough time (many times the age of the universe) and if the universe weren’t expanding, eventually everything would cool to the same temperature. But the hot gas from, say, a supernova may take thousands of years to cool by radiating photons. This happens only when particles collide, and in the low densities of interstellar space, they don’t collide often.