A very complicated one: basically the exact motion and temperature structure of the gas of the star greatly influences the spectrum.
So people run spectral synthesis codes of varying complexity, essentially simulating the entire star, and tweak the parameters to get good agreement between observed and simulated spectra.