One cannot tell by the light spectra. Hydrogen and antihydrogen would give the same lines in the spectrum.
The prevalence of matter over antimatter from other evidence indicates matter is predominant in the observable universe, and here is a nice review.
How do we really know that the universe is not matter-antimatter symmetric?
The Moon: Neil Armstrong did not annihilate, therefore the moon is made of matter.
The Sun: Solar cosmic rays are matter, not antimatter.
The other Planets: We have sent probes to almost all. Their survival demonstrates that the solar system is made of matter.
The Milky Way: Cosmic rays sample material from the entire galaxy. In cosmic rays, protons outnumber antiprotons $10^4$ to $1$.
The Universe at large: This is tougher. If there were antimatter galaxies then we should see gamma emissions from annihilation. Its absence is strong evidence that at least the nearby clusters of galaxies (e.g., Virgo) are matter-dominated. At larger scales there is little proof.
However, there is a problem, called the "annihilation catastrophe" which probably eliminates the possibility of a matter-antimatter symmetric universe. Essentially, causality prevents the separation of large chucks of antimatter from matter fast enough to prevent their mutual annihilation in the early universe. So the Universe is most likely matter dominated.
So the astronomers presume they are detecting hydrogen, based on the analysis above.
Maybe depending on the way the antihydrogen's nucleus interacts with electrons. If it repels it then it is antihydrogen and it is a bit of antimatter. If it attracts then it is not antihydrogen and it is regular old hydrogen. Also antihydrogen will explode with more hydrogen more hydrogen will not explode with other hydrogen. Why the universe is made of matter is an open question however one major reason is because the universe did baryogenesis which is basically where antileptons turn into baryons. Also leptogenesis happened where antibaryons turned into leptons. The conservation law is (B-L) instead of a separate conservation law for baryons and leptons. If this process is observed then also you know you are dealing with antiprotons and positrons.