This has happened to me a number of times--of seeing beautiful rainbows after the rain. And in most cases, all I can do is sigh because I didn't have anything with me to capture the moment.
It's a good thing that today, my bag is still in the laundry so I had to temporarily use my camera bag to hold my IDs, ATM/Credit cards, and other stuff. In effect, I also took with me my camera and was lucky to be able to spot this scene with a rainbow (see photos below).
The morale of the story is that, some photographic opportunities come unexpected so it's best to have a camera readily at hand to capture these moments.