Jay M. Pasachoff is Field Memorial Professor of Astronomy at Williams College in Massachusetts. He sent this answer:
"Trigonometric parallax--the tiny, apparent back-and-forth shifts of nearby stars caused by our changing perspective as the earth orbits the sun--can indeed be used to measure distances only to comparatively nearby stars. Some of the best data on stellar positions in the sky come from Hipparcos, a spacecraft launched in 1989 by the European Space Agency. Hipparcos has measured the trigonometric parallaxes of about 10,000 stars to an accuracy of better than 10 percent, out to a distance of about 300 light-years. But our galaxy is about 100,000 light-years across, so parallax measurements become useless long before we approach the distances to other galaxies.
"The traditional way to measure distances to nearby galaxies is by studying variable stars, especially a type of bright variable star known as a Cepheid variable. Early in this century Henrietta Swan Leavitt discovered that the longer the period of variation of a Cepheid variable, the greater its luminosity. Another American astronomer, Harlow Shapley, then was able to correlate the brightnesses of Cepheids with those of known types of ordinary stars, tying Leavitt's relative distance scale to an absolute one. Thus, we can observe a Cepheid, note how long it takes for its brightness to vary and plot that information on an already established graph to find out its intrinsic luminosity. Comparing this true brightness (its 'absolute magnitude') with its apparent brightness as seen in the sky (its 'apparent magnitude') allows us to calculate how far away it is, using the inverse-square law of brightness. "Fortunately, Cepheids are luminous enough that they can be observed in other galaxies, not just in our own. In the 1920s Edwin Hubble used the period-luminosity relation for variable stars to establish the distances to various galaxies and proved that they lie far outside our Milky Way. In the course of that work, he discovered what we now call 'Hubble's law,' that galaxies display a linear relation between distance and redshift (the redshift is the shift in the positions of lines in the galaxies' spectra toward the red end of the rainbow). Hubble's law is the basis for the modern understanding that we live in an expanding universe. After measuring the redshift, which we can do by passing a galaxy's light through a spectrogram, we can deduce the distance using Hubble's law. This technique is the astronomer's basic tool for finding the distances to the farthest things in the universe.
"But of course there are many complications. Maybe the relation between redshift and distance is not quite linear when we get very far out in the universe. Maybe there are giant concentrations of mass that distort what is otherwise thought to be a smooth, outward expansion, or 'Hubble flow.' Maybe the expansion of the universe inferred by Hubble is accelerated by a 'cosmological constant' in Einstein's equations, the solutions of which are the basis for theoretical cosmology. And measurements of the rate of the cosmic expansion remain controversial. The Hubble Space Telescope is in the process of observing a large set of Cepheid variables in distant galaxies in order to resolve this question.
"Cosmologists are also turning their attention to other bright objects that can be seen at great distances as a way of verifying the accuracy of their measurements. A certain kind of exploding star, or supernova (called a Type Ia supernova), always seems to have the same peak luminosity, so these supernovae can be used as 'standard candles' instead of Cepheids. Supernovae are billions of times brighter than Cepheids; as a result, they can be observed at far greater distances. A number of researchers are trying to exploit this advantage and get more accurate information about the size and age of the universe. The Hubble Space Telescope is assisting in this work as well.