https://en.wikipedia.org/wiki/H_II_region wrote:
<<An HII ("H two") region is a region of interstellar atomic hydrogen that is ionized. It is typically a cloud in a molecular cloud of partially ionized gas in which star formation has recently taken place, with a size ranging from one to hundreds of light years, and density from a few to about a million particles per cubic cm. HII regions consist of about 90% hydrogen. The strongest hydrogen emission line, the H-alpha line at 656.3 nm, gives HII regions their characteristic red colour. (This emission line comes from excited un-ionized hydrogen.) The lifetime of an HII region is of the order of a few million years. Radiation pressure from the hot young stars will eventually drive most of the gas away. In fact, the whole process tends to be very inefficient, with less than 10 percent of the gas in the HII region forming into stars before the rest is blown off. Contributing to the loss of gas are the supernova explosions of the most massive stars, which will occur after only 1–2 million years.
HII regions may be of any shape, because the distribution of the stars and gas inside them is irregular. The short-lived blue stars created in these regions emit copious amounts of ultraviolet light that ionize the surrounding gas. HII regions—sometimes several hundred light-years across—are often associated with giant molecular clouds. They often appear clumpy and filamentary, sometimes showing intricate shapes such as the Horsehead Nebula.
Stars form in clumps of cool molecular gas that hide the nascent stars. It is only when the radiation pressure from a star drives away its 'cocoon' that it becomes visible. The hot, blue stars that are powerful enough to ionize significant amounts of hydrogen and form HII regions will do this quickly, and light up the region in which they just formed. The dense regions which contain younger or less massive still-forming stars and which have not yet blown away the material from which they are forming are often seen in silhouette against the rest of the ionised nebula. Bart Bok and E. F. Reilly searched astronomical photographs in the 1940s for "relatively small dark nebulae", following suggestions that stars might be formed from condensations in the interstellar medium; they found several such "approximately circular or oval dark objects of small size", which they referred to as "globules", since referred to as Bok globules. Bok proposed at the December 1946 Harvard Observatory Centennial Symposia that these globules were likely sites of star formation. It was confirmed in 1990 that they were indeed stellar birthplaces. The hot young stars dissipate these globules, as the radiation from the stars powering the HII region drives the material away. In this sense, the stars which generate HII regions act to destroy stellar nurseries. In doing so, however, one last burst of star formation may be triggered, as radiation pressure and mechanical pressure from supernova may act to squeeze globules, thereby enhancing the density within them.
Typically HII regions reach temperatures of 10,000 K. They are mostly ionised gases with weak magnetic fields with strengths of several nanoteslas. A number of HII regions also show signs of being permeated by a plasma with temperatures exceeding 10,000,000 K, sufficiently hot to emit X-rays. X-ray observatories such as Einstein and Chandra have noted diffuse X-ray emissions in a number of star-forming regions, notably the Orion Nebula, Messier 17, and the Carina Nebula. The hot gas is likely supplied by the strong stellar winds from O-type stars, which may be heated by supersonic shock waves in the winds, through collisions between winds from different stars, or through colliding winds channeled by magnetic fields. This plasma will rapidly expand to fill available cavities in the molecular clouds due to the high speed of sound in the gas at this temperature. It will also leak out through holes in the periphery of the HII region, which appears to be happening in Messier 17.
The precursor to an HII region is a giant molecular cloud (GMC). A GMC is a cold (10–20 K) and dense cloud consisting mostly of molecular hydrogen. GMCs can exist in a stable state for long periods of time, but shock waves due to supernovae, collisions between clouds, and magnetic interactions can trigger its collapse. When this happens, via a process of collapse and fragmentation of the cloud, stars are born.
As stars are born within a GMC, the most massive will reach temperatures hot enough to ionise the surrounding gas. Soon after the formation of an ionising radiation field, energetic photons create an ionisation front, which sweeps through the surrounding gas at supersonic speeds. At greater and greater distances from the ionising star, the ionisation front slows, while the pressure of the newly ionised gas causes the ionised volume to expand. Eventually, the ionisation front slows to subsonic speeds, and is overtaken by the shock front caused by the expansion of the material ejected from the nebula. The HII region has been born.>>