Are you forever chasing rainbows, but never bringing home the bacon? Well, you wouldn't be alone there. Photographing rainbows doesn't need a lot of skill, but it does require quite a bit of luck to get one in the right position for a good exposure.
As we all know, rainbows will only appear when the sun is shining through either raindrops or sprinkled water. They can even simply appear sometimes in clouds or mist, so one must be at the ready at all times.
Depending on how high and how bright the sun is at the time, will give some indication on how high and how bright the rainbow will be. So if it is about mid to late afternoon or early to mid-morning, then your rainbow should be quite high and colourful.
A dark backdrop of blackened clouds or a darkened hillside will also enhance the colours of the rainbow, but be aware of the foreground. Try to eliminate things like power poles and cables, buildings, etc. Look for something of more interest to include in the area.
If there is a horizon in your shot, don't forget to make sure it is level and try not to place it in the centre of the frame.
As far as equipment goes, obviously, you can't go past the trusty old tripod as you will at times, be working with slow shutter speeds due to darkened backgrounds. The lens is not critical. In fact, a zoom in the range of 18 - 200mm will offer some good shooting options from a wide angle to close in.
Some say not to use a polarizer, because a rainbow, being reflected light, will not respond well to its use.
Neutral density or grey grads can be useful for darkening the background, but they will not jeopardise the rainbow's colours. Set your ISO rating as low as possible to allow for clarity and stronger, saturated colours.
If you can manually operate your camera, switch it to aperture priority and set it in the mid-range.
Finally, make sure you have a good, undercover vantage point. The last thing you want is to have a cloudburst when you least expect it.