Regardless of what ions are present, the emission lines are very narrow and
have a very precisely defined spacing. Hydrogen in its various ion forms is
very distinctive, as are various helium isotopes, etc. They simply match up
the pattern of emission lines with the various known spectra... There are
only so many combinations. Then the offset from where these lines should be
to where they appear gives the redshift factor (or even blueshift if
something was coming at us).
The PFM and wild guessing department comes in on the assumption that the
universe is expanding uniformly and converting the redshift derived velocity
to distance.
-jrp