|MadSci Network: Chemistry|
Well, the simple answer is that a very stable foam is being created when the two materials meet. But I'll try to explain a little better: sodas contain a lot of carbon dioxide - more than would normally be present at atmospheric pressure or room temperature. This CO2 is dying for a way to escape into the atmosphere as fast as possible and uses anything it can (like rough surfaces, small particles or shaking) to accelerate the escape process.
Ice cream, on the other hand, is pretty stable. It contains a lot of milk proteins, sugars and (obviously) ice crystals. When the soda meets the ice cream, the CO2 coagulates on the irregular surfaces (ice crystals), forming large bubbles. The milk proteins from the ice cream coat the bubbles, producing a very stable foam. By the time you are done pouring the soda, you have a very frothy float, brown cow, or whatever else you want to call this ice cream soda.
So, I hope I have answered your question. And you have great timing as the weather is just about right to enjoy this tasty concoction. ;)
Try the links in the MadSci Library for more information on Chemistry.