SPECTRAL ANALYSIS OF STARS
Find out the temperature of a star and its chemical composition by analysing the light from the star!
Why should star light be different from white light?
We have a reason to expect star light will not just be the white light spectrum. There should be certain wavelengths missing.
The inner layers of the star are hotter and denser. They tend to radiate all colours like a hot solid, the upper layers act like a low density gas. The gas absorbs certain wavelengths depending on its composition which appear as absorption lines in the spectrum of the star.

(Here you can see the absorption lines in different regions of the spectrum of Betelgeuse)
Analysing the spectral lines
The absorption lines can be identified with individual chemical elements or molecular compounds by comparing their positions in the spectrum with those observed from pure sources in the laboratory. The intensity or “blackness” of the absorption line reflects on how much that particular chemical element was capable in removing energy from the spectrum. This depends mainly on two factors: The efficiency of the element and its abundance. Efficiency of the element depends on the number of electrons that the element has. For example, calcium shows a more intense line than hydrogen because calcium has more electrons for excitation. Hence this factor must be taken into consideration before interpreting the spectrum for the abundance of the chemical element.
The absorption coefficients also depend on the temperature of the star. Hence, you’ll find that few of the stars show very strong hydrogen lines while some do not show any hydrogen lines but show lines of titanium dioxide! To aid in understanding the composition of stars, astronomers classified the stars into spectral types. The main spectral classes are O, B, A, F, G, K, M. Here is an example of the spectrum for each spectral class.

O- Ionised helium
B- Neutral helium e.g. Spica, Pleiades.
A- Hydrogen e.g. Sirius, Deneb, Altair, Vega.
F-Weaker Hydrogen, ionised metals. e.g. Canopus, Polaris.
G- Still weaker hydrogen, ionised and neutral metals e.g. Capella, Sun.
K- Weak hydrogen, neutral metals e.g. Arcturus, Aldebaran.
M- Neutral molecules and metals e.g. Betelgeuse, Antares.
Estimating temperature of the star
The intensity vs. wavelength length plot of the spectrum roughly follows the pattern of a black body radiation. The easiest way to find out the temperature of the star is to find out the wavelength of the maximum radiation and apply Wien’s displacement law to get the temperature. But Wien’s law lets us quantify the temperature only for Planck-like spectra. Stars don’t exactly have a Planck-like spectrum.
The best way to estimate its temperature is from the H-R diagram which a plot of all the known stars graphed according to absolute visual magnitude on the vertical axis and spectral class on the horizontal axis. The graph is characteristic and is divided in the main sequence stars, the red giants, the blue giants and white dwarfs.

References
http://stars.astro.illinois.edu/sow/spectra.html
http://hyperphysics.phy-astr.gsu.edu/hbase/starlog/staspe.html