How deep is a rainbow? My cousin shot this photo of a rainbow in front of a mountain.
In the picture it is clear that the mountain is behind the rainbow (the rainbow blocks the view of the mountain), whereas the nearby trees are in front of the rainbow. This got me thinking: how thick (deep) is the rainbow?
To make that more precise, imagine a plane taking off from the top of the mountain behind the rainbow and flying straight towards the camera. You could measure the relative strength of the plane / rainbow in the picture by a simple linear fit (assuming you knew its location). I imagine you'd see something like this:
Graph showing intensities of plain and rainbow http://167.160.167.208/rainbow-depth.png
How thick would this region be?
 A: You don't really "look at the rainbow". You look at light that was refracted in rain drops. Where the drops are, the refraction happens. And as long as the density of water drops does not impede your view, the depth is "infinite".
In other words - any drops that present a certain viewing angle (in the triangle sun-drop-eye, the angle subtended from sun to eye is the same) will give the same color, regardless of the distance.
So there is no real answer, because it will depend on the density of the rain drops. Once the probability of a drop being in the way becomes substantial, you reach the limit of your rainbow "depth".
"Heavy rainfall" is considered anything above 0.3" (7.6 mm) per hour. Rain drops fall at rates between 1 m/s and 10 m/s (source). Let's say the average size is 2 mm with a terminal velocity of 6 m/s; This means that in 1 hour, a column of about 20 km (6*3600) "falls", creating a layer of water that is 8 mm thick.  When a rain drop (volume $\frac43 \pi r^3$) hits the ground (area $\pi r^2$ it creates a "puddle" of depth $\frac43 r \approx$ 1.3 mm deep. Six of these drops would correspond to 8 mm, so on average mean free path between drops is 20 km / 6 = 3 km.
That means that in "heavy rain" you expect to see a rainbow with a depth up to 3 km. As the rain gets heavier, the depth reduces; if it's lighter, it can be more.
The above is very approximate...
A: In terms of geometrical optics, the rainbow is a virtual object at infinity, as the rays arriving at the observer's eyes are perfectly parallel. Even if the rainbow is made by nearby droplets from a garden hose, the rainbow is a virtual object at infinity.
Its infinite distance would be more evident if the sun was a point source, and the rainbow was viewed through a monochromatic filter. In those circumstances the rainbow would be a perfectly sharp circle, and photos would be sharp only if the camera was focused at infinity. 
It is somewhat similar to looking at the moon through a mirror: the observer is watching a virtual object infinitely far behind the mirror. Similarly the rainbow is infinitely far behind the reflecting raindrops. 
The rainbow in your cousin's photo seemed to be in front of the mountain. However, geometrical optics ignores the scenery; you have to extrapolate the rays back to a virtual image behind the mountain. Similarly, the image of the moon in a mirror could be located behind the mountain.
The common idea that the rainbow is located inside the rain curtain, instead of at infinity, is at odds with geometrical optics. That idea results from confusing the reflectors with the image.
