A rainbow appears when sunlight passes through bits of water in the air