We can detect the presence of an element in, say, a star because of the frequency of light that it absorbs which produces a line on an absorption spectrum. And we can detect relative motion towards or away from Earth because of a Doppler shift. But how do we know that we are seeing a shifted spectral line of one element and not the unshifted or differently shifted spectral line of another element?
2 Answers
This is because the different spectral lines of an element form a characteristic pattern and you would usually see the Doppler shift also in other known lines of the characteristic spectrum of an element.
The key is the difference in the wavelength of the spectral lines of a certain element. Since the wavelengths of light all traveled the same distance, they would be red shifted equally, thus retaining the difference in their respective wavelengths.