The Doppler effect, named after Austrian physicist Christian Doppler who first proposed it in 1842, is the result of an object which is emitting radiation, moving relative to an observer.
If the source of radiation, say a star, is moving toward an observer, say an astronomer on Earth, than the wavelength of the radiation will appear shorter (higher frequency, and therefore higher energy). And, conversely, if the object is moving away from the observer than the wavelength will appear longer (lower frequency, and lower energy).
The doppler effect is responsible for such technologies as police radar, where the "radar gun" emits light of a known wavelength. Then, the radiation bounces off of a moving car and travels back to the instrument. The resulting shift in wavelength is used to calculate the speed of the vehicle. (Note: it is actually a double shift as the moving car first acts as the observer and experiences a shift, then as a moving source sending the light back to the office, thereby shifting the wavelength a second time.)
When an object is receding (i.e. moving away) from an observer, the peaks of the radiation that are emitted will be spaced farther apart than they would be if the source object were stationary. The result is that the resulting wavelength of light appears longer.
By similar means, spectral lines (in the case of spectroscopic measurements) will appear shifted toward the red end of the optical spectrum. (The same effect applies to other bands of the electromagnetic spectrum, such as radio, X-ray or gamma-ray, but optical measurements are the most common and are the source of the naming "redshift".)
The more quickly the source is receding from the observer, the greater the redshift. From an energy standpoint, longer wavelengths correspond to lower energy radiation.
Conversely, when a source of radiation is approaching an observer the wavelengths of light appear closer together, effectively shortening the wavelength of light. (Again, shorter wavelength means higher frequency, and therefore higher energy.) Spectroscopically, the emission lines would appear shifted toward the blue side of the optical spectrum, hence the name blueshift.
As with redshift, the effect is applicable to other bands of the electromagnetic spectrum, but the effect is most often times discussed when dealing with optical light, though in some fields of astronomy this is certainly not the case.
Expansion of the Universe
In the early 1900s it was believed that the Universe was static. In fact, this led Albert Einstein to add the cosmological constant to his famous field equation in order to "cancel out" the expansion (or contraction) that was predicted by his calculation. Specifically, it was believed that the edge of the Milky Way represented the boundary of the static Universe.
Then, Edwin Hubble found that the so-called "spiral nebulae" that had plagued astronomy for decades were in fact not nebulae at all, but rather whole other galaxies and that the Universe was much larger than we could possibly imagine.
Hubble then proceeded to measure the doppler shift, specifically finding the redshift, of these galaxies and found that the further away a galaxy was, the more quickly it was receding. This led to the now-famous Hubble's Law, whereby an object's distance is proportional to its speed of recession.
This revelation led Einstein to write that his addition of the cosmological constant to the field equation was the greatest blunder of his career. Interestingly, however, some researchers are placing the constant back into general relativity.
Because as it turns out Hubble's Law is only true up to a point, since research over the last couple decades has found that distant galaxies are receding more quickly than predicted; specifically, it appears that the expansion of the Universe is accelerating. The reason for this acceleration is a mystery, and scientists have dubbed the driving force of this acceleration dark energy. And they account for it in the Einstein field equation as, you guessed it, a cosmological constant. (Though it is of a different form than Einstein's formulation.)
Other Uses in Astronomy
Besides measuring the expansion of the Universe, the doppler effect can be used to model the motion of things much closer to home; namely the dynamics of the Milky Way Galaxy.
By measuring the distance to stars and their redshift of blueshift, astronomers are able to map the motion of our galaxy and get a picture of what our galaxy may look like to an observer across the Universe.
The doppler effect also allows us to measure the pulsations of variable stars, as well as motions of particles traveling at incredible velocities inside relativistic jet streams emanating from supermassive black holes.