heating and cooling balance in the interstellar medium depends on density, ionization, radiation and shielding. Write net cooling per volume as . Ultraviolet grain photoelectric heating is important in diffuse neutral gas; photoionization heats ionized regions, cosmic rays penetrate shielded gas, and shock waves from stellar winds and supernovae supply hot gas. Cooling includes collisionally excited atomic lines, fine-structure metal lines at lower temperatures, molecular lines in shielded clouds, and continuum radiation and dust emission where appropriate. The heating efficiency and cooling abundances matter as much as a nominal temperature.
A multiphase interstellar medium can contain a cold neutral medium near , a warm neutral medium and warm ionized medium near , a hot ionized medium near , and still colder molecular clouds. Cold and warm atomic equilibrium branches can coexist at similar thermal pressure over a finite pressure interval; this is a calculated heating/cooling balance, not a requirement that all galactic gas have the same pressure.[ref]
The Neutral Atomic Phases of the ISM in the Galaxy by Mark G. Wolfire and others. Abstract: cold and warm neutral equilibrium temperatures and coexistence between minimum and maximum pressures
For net cooling per unit mass , an isobaric perturbation at equilibrium obeys . Thus a negative constant-pressure cooling derivative is thermally unstable: a cool perturbation cools further and condenses. Sound crossing must be fast enough to maintain pressure balance; thermal conduction suppresses sufficiently short wavelengths. Supernova-driven motions, magnetic pressure, finite cooling times and interfaces make the actual medium dynamic, so equilibrium branches describe useful phases rather than a static collection of perfectly separated components.