It's obvious that an object passing in front of a star can dim the star's light, but it can also change the color of the star's light. The Rossiter-McLaughlin Effect, which explains the mechanism of that shift in color, has been used to find "hot Jupiter" exoplanets, and has even been measured during the transit of Venus. Here's how a planet can shift a star from red to blue and back again.
Doppler Shift is one of the earliest physical concepts that physics teachers talk about in high school. It provides a straightforward explanation for an everyday phenomenon - the change in tone of car horns as they whiz by us. An approaching car emits sound waves, but those waves bunch up together the way water waves do at the prow of a ship. Because we interpret sound as the number of waves that hit our ear over a certain period of time, the bunching of those sound waves makes us hear a higher tone. As the car speeds away the sound waves spread out behind it, and we hear a lower tone. This is why the sound of car horns - or any sound - drops a few notes as it moves past us.
A similar phenomenon happens with light. The light wave from approaching objects goes "up" a few notches in frequency, becoming more energetic. In sound this would mean shift toward a higher note. In visible light, this means a shift toward a bluer tone. If the object is moving away, the shift is to a red, or less energetic, tone. These shifts in tone can occur anywhere in the spectrum of light, even in light like infrared or ultraviolet, which we can't see. Still, the upward shifts are called blue shifts, and the downward shifts are called red shifts.
Stars often rotate in space, the same way planets do. When we look at these spinning stars, the half of the star that is turning away from us is technically getting farther from us, even though the star itself may not be moving in comparison to our position. Meanwhile, the section that's spinning forward is approaching us. Because of this, the light from the section that's spinning away is red shifted, and the one that's spinning forward is blue shifted. This leads to a specific overall color composition of the star. The Rossiter-McLaughlin Effect kicks in when some object - usually a binary star but possibly a big planet - moves in front of the star. The object covers up, alternately, the red shifted or blue shifted portions of the star. This causes the overall spectral composition of the star to change, the same way the overall lighting in a room would change if it were light by a red light and a blue light, and a person put a hand over one of them and then the other.
The Rossiter-McLaughlin Effect is very subtle, and doesn't generally occur with light that human beings would be able to see with the naked eye. It is, however, useful. It's been used to discover large, gaseous exoplanets around distant stars, and a research team has even managed to spot it in our own sun during the transit of Venus in 2012. Obviously, the planets and stars have to be aligned right to make it work, but this effect could help us discover binary systems and exoplanets well into the future.
Image: NASA; ESA; G. Bacon, STScI