When white sunlight is intercepted by a drop of water in the atmosphere, some of the light refracts into the drop, reflects from the drop's inner surface, and then refracts out of the drop.
As with the prism, the first refraction separates the sunlight into its component colors, and the second refraction increases the separation. The result is the rainbow.

The following applet shows many light rays heading for the water drop (white circle).
Because the incident angle are not the same for different incoming ray, the second refraction ray coming out at different angle.
[b]The question is why we always saw the rainbow at a fix angle relative to the sun ray?[/b]

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/rainbow2_pkg/rainbow2.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Download EJS jar file(1289kB):double click downloaded file to run it. (93 times by 62 users) , Download EJS source (28 times by 19 users) View EJS source  You can click the "real intensity" checkbox to find out the relative intensity for different paths.
You can drag the black square near the left side of the simulation to drag those rays up and down.

You might notice that intensity for incoming rays are not the same. It is indicated that the cross section are not the same for different ray.
If the ray is off by the center of the water drop by distance b, and the rasius of the circle is R.
The incident angle $\theta$, where $\sin\theta=b/R$, the effective cross section is proportional to $\cos\theta$

If the index of refraction is n, the refracted angle $\phi$, where $\sin\phi=b/R/n$ ( i.e. $sin\theta= n \sin\phi$).

If the intensity of incoming ray is $I$, then the intensity for the reflected ray(s wave) is  $I_r=\frac{\sin^2(\theta-\phi)}{\sin^2(\theta+\phi)} I$ and the intensity for refracted light is $I'= I-I_r$

The above formulas are used to calculate the intensity for different ray.