When an emission line of helium from a galaxy is shifted toward the red end of the spectrum, it indicates that the galaxy is moving away from the viewer. This phenomenon is known as redshift and is commonly observed in the context of the expanding universe. Therefore, the correct answer is:
D. the galaxy is moving away from the viewer.