So the spectra itself helps us to identify elements present, and the line strength tells us about the temperature, density, and pressure of the gas. Stars are arranged in spectral classes based on the number and appearance of the spectral lines. Each class can be further subdivided from 0-9. As an example, an A-type star can be an A0, or A5, up to A9. Each spectral class corresponds to a different temperature in the gases in the light-emitting layers of the stars.
Temperature is merely a measure of the average velocity of the atoms or molecules of a substance.
The hotter a gas, the faster its atoms and molecules move. If the temperature quadruples, the velocities of all particles double. Fast-moving free electrons can dislodge electrons from the outer orbits of a neighboring atom. Because spectral lines depend on electron structures, and because spectral classes depend on spectral lines, spectral classes therefore form a temperature sequence. The Doppler Effect is a shift in wavelength of a spectral absorption or emission line away from its normal wave-length, caused by motion of the light source toward or away from the observer.