How do astronomers distinguish the spectral lines?
The lines show as either peaks above the black body emission (for emission lines) or troughs below the black body emission (for absorption lines). Though stars more often have absorption lines and nebulae emission.