Dark nebulae are large concentrations of dust which obscure background light through interstellar extinction. Reflection nebulae arise from dust which scatters mainly blue light from nearby stars into the observer's line of sight. Planetary nebulae consist of shells of gas which have been expelled from low mass stars evolving towards white dwarfs. The hot, exposed core of the star ionizes and heats the expanding shell which then produces an emission line spectrum. They consist of hot ionized gas filaments, high energy electrons, and magnetic field.
Stars form from the gravitational contraction of dense clumps of cold, molecular gas.
The gravitational contraction is resisted by thermal pressure , rotation , and magnetic fields . Ignoring rotation and magnetic fields, the evolution of a contracting clump of molecular gas proceeds as follows. The cloud is at first relatively transparent to photons and is able to radiate away all the gravitational energy released in the contraction. Because the temperature therefore does not rise but the gravity increases, smaller portions of the cloud can collapse and the cloud fragments . As the density of the individual fragments climbs higher, they eventually become opaque to photons and start to heat up.