From the Super Mario Wiki
Retrieved from "http://www.mariowiki.com/index.php?title=Rainbow_Star&oldid=1844314"
The Rainbow Star is an item that appears in Super Mario Galaxy and Super Mario Galaxy 2. When collected, it transforms Mario into Rainbow Mario (or Luigi into Rainbow Luigi), causing him to become rainbow-colored and leave a trail of light behind him whenever he runs. In this form, he is invincible, can break through certain objects and obstacles, can run faster, and can jump both farther and higher. As the power-up begins to wear off, the music, along with Mario's running speed, will get faster and faster until it wears off completely. The Rainbow Star might have been colored differently to differentiate it from Power Stars, which are, in both Super Mario Galaxy and Super Mario Galaxy 2, the items that must be collected in order to complete the game. The theme that plays after collecting a Rainbow Star is a remixed version of the classic invincibility music.