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 the clouds, 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 hill side will also enhance the colours of your rainbow, but be aware of your 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 ensure it is level and try not to place it across the centre of your 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 25 - 200mm will offer some good shooting options from wide angle to close in.
Some say not to use a polariser, because a rainbow, being reflected light, will not respond well to its use, but I would advise, if you have time, to at least give it a try, as it will deepen background colours and by that alone it can only enhance the look of your rainbow.
Neutral density or grey grads can be useful also 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 from f8 - f11.
Finally, make sure you have a good, under cover vantage point. The last thing you want is to have a cloud burst when you least expect it.