Spectral Line Profiles in Emitting Layers