Take light from an entire galaxy, rather than from a single star. The details of the spectra are much less distinct than in the spectrum of an individual star, but they are still discernible. The simplest result of galactic spectra studies is that almost all of them are red-shifted.
Although there are other possible origins of a red-shift, this one is almost universally presumed to arise from the motion of the galaxies; it is a Doppler shift. Almost all the external galaxies seem to be moving further away.
Hubble, in the late 1920's, discovered a correlation between the amount of the red-shift, and the distance to the galaxy: the further the galaxy, the larger the shift. The graph of the red-shift versus the distance is called the Hubble Diagram. The relationship is: speed=constant × distance; this is known as Hubble's Law. The ``constant'' in Hubble's Law is called the Hubble constant and is about 50 km/sec/megaparsec.