Why beer suddenly foams up when you tap the top of a bottle

If you tap the top of someone's beer bottle with the bottom of yours, it instantly creates a beer foam volcano. So what's causing this?