the rainbow brick is the exit, you destroy it to advance to the next level. It is randomly generated somewhere in the level, so it can be a bit hard to find.