The bubbles show rainbow colors under the sun because the sun light refracts into the bubble, being separated in the rainbow colors.
When the white light enters the bubble, it is decomposed, and each different color will have a slightly different direction: