Rainbows happen when sunlight and rain combine in a very specific way. The beams of sunlight separate into the colors we see in the rainbow as they enter a raindrop. Sunlight is actually made up of different colors that we don't usually see. When a beam of sunlight comes down to Earth, the light is white.
A rainbow table is a precomputed table for reversing cryptographic hash functions, usually for cracking password hashes. Tables are usually used in recovering a plaintext password (or credit card numbers, etc.) up to a certain length consisting of a limited set of characters.