In Sonic 3 (and by extension, Sonic 3 & Knuckles) there is a Gumball-dispenser bonus stage which dispenses different power-ups, including the various shields, rings, extra lives and a few other arena-specific ones, such as the rubber/bounce balls.
You can watch the bonus stage in action here:
What are the chances that the gumball machine dispenses one type of ball over another? Are they uniformly released, or does say, a Bubble shield appear more often then an extra life?