For example, a dominant characteristic of spectral class A stars is the presence of strong hydrogen lines, but ionized helium lines are only present in the class O stars. As noted above, since helium ionizes only at high temperatures, this tells us that class O stars must have very high surface temperatures. On the other hand, spectral lines associated with molecules are only found for spectral classes K and M. This is because these correspond to low surface temperatures, and molecules can only hold together in stars with relatively low surface temperatures. http://csep10.phys.utk.edu/astr162/lect/stars/spectra.html