The light does travel in straight lines, from the sun to a raindrop, where it is reflected and refracted, then from the raindrop to you. The colour depends on the angle of refraction. If you look upward, or to left or right on the rainbow, the angle from you to the rainbow is the always the same. That's why it's an arc. if you were high enough above the ground, you'd see it as a circle. (You can sometimes see this circular effect from a plane when flying over clouds).