Both models are entirely procedural. This example is a relatively crude model and requires some manual hacking of settings to position accurately.
The second model I was working on might require a single hack as a workaround to a specific problem, but this may be remedied with the next update. The second model will be nerdishly accurate.
Construction of this model:The basis of this model is a spherical gradient from 0-1 at a set distance from a specified point with a fixed width. The sphere is then sliced perepndicular to the camera to produce a torus-like shape (I used my terrain blending mask, but a couple of distance shaders would have done the trick)
This is then fed into 5 colour adjust shaders, 1 for each change in RGB values to make up the spectrum (2 red, 2 green, 1 blue). These are then combined to make 3 shaders representing the RGB values of the rainbow.
An additional colour adjust node sets the entire width of the rainbow to 1. This is used as a blending shader for the cloud density shader. The density shader is then fed into 3 surface shaders (as a child), using the R,G,B shaders above as blending shaders.
A cloud layer is then created for the rain and duplicated. In this case I just have the rainbow without additional rain, so there are 3 cloud layers. The colour of the cloud layers are set to red, green and blue, using the corresponding surface shader as a density fractal.
[attachthumb=#1]
This shows you the construction of this model. No rocket science here, just some crude (but creative) masking
The bottom 2/3 (what to do with the 0-1 gradient) of this is pretty much sorted and is common to both models. There are a couple of extra bits left from previewing the result on the terrain as it's quicker to preview as a surface layer.
What's nextThe second model will actually use the position of the sun to produce a conical mask spreading out from the camera. This will remove the need to manually position the centre of the sphere and then slice the sphere.
The rest is basically all thanks to the volumetric cloud model in TG2, and with some finetuning should produce some very realistic looking rainbows.
Both models should easily slip into an existing scene that uses clouds to simulate rainfall.