Have you ever noticed the way the pitch of a train whistle changes as it rushes by you? This is called the Doppler Effect.
The sound of the whistle travels to you via a sound wave. If the train were standing still the whistle would have a certain pitch, determined by the length of the sound waves. As the train moves toward you, the whistle emits each part of the wave a little bit closer to you that the last part. The length of the waves appears shorter, and you hear a higher pitch. After the train passes you , the whistle emits each part of the wave a little bit farther from you than the last part. This makes the length of the waves appear longer, and you hear a lower pitch.
A similar effect happens with light. However, with light, pitch is replaced by color. "Higher pitch" light is bluer, "lower pitch" light is redder. Therefore, when a light source is traveling away from us, we say it is "red-shifted", and when it is traveling towards us, we say it is "blue-shifted".
We can quantify how much the wavelength of the light will change:
Want to see this in action? Try out the Doppler-Tron 2000 below. What happens to the length of the waves as the sources moves faster and faster towards you? away from you? What about the color of the waves?