There are two kinds of expanding foam (same brand) - one does not expand as much or with as much force as the other. From
http://www.homeenvy.com/db/9/49.html :
If you haven't used expanding foam before, go with a low-expansion variety. (The label will indicate whether it's high- or low-expansion.) If you choose a high-expansion foam, use it with an extremely subtle touch. It expands 200-300 percent over a couple of hours. In other words, you only need to squirt in 35 -50% of what you think you need. If you overdo it, you'll have pendulous glops of uncured foam spilling out of crevices, rolling down your walls and spreading itself around like a bad soprano. It cleans up with acetone but not easily, so don't let it get to that point. Also, on the label the manufacturers always print a cryptic cautionary note: "Once the foam has cured, no known chemical will dissolve it. Remove by sanding." If the foam is on your skin, good luck with the sanding part. I'm still smarting.