The interstellar medium is the matter and radiation that fills the space between the stars in a galaxy. It consists of gas, dust, cosmic rays, and electromagnetic radiation. The interstellar medium plays an important role in the evolution of stars, planets, and galaxies, as well as in the propagation of light and radio waves.
The gas can be either neutral or ionized, and can have temperatures ranging from a few kelvins to millions of kelvins. For example, the cold neutral medium has a temperature of about $100$ K and a density of about 1 atom per cubic centimeter, while the hot ionized medium has a temperature of about $10^6$ K and a density of about $0.01$ atom per cm$^3$.
The dust is composed of tiny solid particles that absorb and scatter light, making distant objects appear dimmer and redder. For example, the dust in the Milky Way reduces the brightness of a star by about 1 magnitude for every kiloparsec of distance.
The cosmic rays are high-energy particles that originate from supernova explosions and other energetic events. For example, the cosmic rays in the Milky Way have an energy spectrum that follows a power law with an index of about $-2.7$.
The electromagnetic radiation includes visible light, infrared, ultraviolet, X-rays, and gamma rays, which are emitted by stars, nebulae, and other sources. For example, the electromagnetic radiation in the Milky Way has a luminosity of about $10^{10}$ solar luminosities.
The interstellar medium is constantly changing due to various physical processes, such as shock waves, turbulence, magnetic fields, gravity, and stellar feedback. These processes can create regions of higher or lower density and temperature, such as molecular clouds, interstellar bubbles, supernova remnants, and hot ionized regions. Some of these regions are the sites of star formation, where gravity causes the gas and dust to collapse and form new stars and planets. For example, the Orion Nebula is a giant molecular cloud that contains about 2000 young stars and protostars. Other regions are the remnants of star death, where supernovae eject material into the interstellar medium and enrich it with heavy elements. For example, the Crab Nebula is a supernova remnant that contains a pulsar and emits synchrotron radiation. The interstellar medium also affects the evolution of stars and planets by providing them with material for accretion or erosion. For example, the solar wind interacts with the interstellar medium and forms a heliosphere that protects the solar system from cosmic rays.