The rival battle against Shadow the Hedgehog in Sonic Generations takes place aboard the Space Colony ARK as seen in their last Sonic Adventure 2 boss battle.
After performing the famous opening scene from Sonic Adventure 2 Battle, the fight begins. This battle is more of a race, with the goal being a floating purple sphere. Both Sonic and Shadow try to reach the sphere first. Once they reach it, they get a "power level". Then the sphere reappears and you must obtain it again. After gaining enough levels (depends on the mode how many there are), you will gain a powered up move. If Shadow gets it, he will unleash a barrage of Chaos Spears (as seen on the image), which you will need to dodge. After this, Shadow will literally charge you. If Sonic gets the power, he will get a powered up boost, which looks purple instead of his blue boosting color. In this state, you must hit floating Meteors on the track, which will slow Shadow down. Hit enough to get him close, then when he is within range, boost into him. He will start to lose rings. Continually hit him until he has lost all his rings to win this fight. After the fight is over, you will get a Chaos Emerald.
Also, when he's not boosting, you can attack him to make him lose his rings, but he will not be defeated unless you manage to attack before he collects more Rings.