I don't think there's a lot you can do photographically. I think the quality of the photo will come down to how strong the rainbow is, and how you process the image (either by the choice of picture style/JPEG saturation level in camera, or Raw processing).
It takes a combination of factors which all have to come together to form a strong rainbow — you need strong direct sunlight, but the sun also has to be low in the sky. If it's above 42 degrees then the rainbow will fall below the horizon. Generally, when the sun is lower in the sky, it's not as strong. Midday in the winter, or morning/late afternoon in summer will give you the best strength to angle ratio, though it depends on your latitude. You also need an abrupt boundary between clear sky and rain, such as you get with a heavy thunderstorm. These also tend to bring wind, which disperses the cloud — making the rainbow shortlived. This is why really good rainbows happen rarely: they require many competing factors.
Aperture/shutter speed aren't going to make a huge difference, provided your shutter is fast enough to avoid camera shake. You're going to need a fairly wide lens to capture a rainbow, so depth of field is not going to be a problem. I'd opt for a usually-optimum aperture of f/5.6 (or maybe f/8). The main arc of a rainbow is always 42 degrees from the centre, so you need an 84° FOV to capture an entire rainbow. This corresponds to at least 20mm lens (full frame) or 12.5mm lens on a crop body. Rainbow light is strongly polarized, so take off the filter (as mmr states).
For post processing, a contrast/saturation boost will help bring out the rainbow colours and give the image some punch.