A raindrop acts in much the same way. Below is a digram of how a raindrop refracts and disperses white light into color. White light enters into the the raindrop, it is refraced and dispersed, and out the other side comes color.
http://science.howstuffworks.com/rainbow2.htm
Now that the basics have been established, how is it that we see the colors? The figure bnelow shows how this is done.
http://science.howstuffworks.com/rainbow2.htm
AbAccording to HowStuffWorks.com "When raindrop A disperses light, only the red light exits at the correct angle to travel to the observers eye. The other colored beams exit at a lower angle, so the observer doesn't see them. The sunlight will hit all the surrounding raindrops in the same way, so they will all bounce red light onto the observer. Raindrop B is much lower in the sky, so it doesn't bounce red light to the observer. At its height, the voilet light exits at the correct angle to travel to the observers eye. All the drops surrounding raindrop B bounce light in the same way. The raindrops between A and B all bounce different colors of light to the observer, so the observer sees that full color spectrum."