Hitting a glass bottle full of a non-carbonated drink can shatter the bottle due to cavitation, but doing the same with a carbonated beverage can make the bottle overflow with foam. The video above breaks down the physics of this bar prank. It all begins with nucleation and the tiny bubbles of carbon dioxide that form in the liquid. Striking the top of the bottle generates a compression wave that travels through the liquid, shrinking bubbles as it passes. When it hits the bottom of the bottle, it gets reflected as an expansion wave that expands the bubbles. This reflection happens several times between the free surface of the liquid and the bottom of the bottle. The rapid collapse-and-expansion of the bubbles makes them implode into a cloud of tinier bubbles that expands until the local supply of carbon dioxide is used up. At this point, the buoyancy of the bubbles carries them upward in plumes, creating more bubbles with the dissolved carbon dioxide nearby. And, all of a sudden, you’ve got foam everywhere. Like all of this week’s videos, this video is an entry in the 2013 Gallery of Fluid Motion.