I had always been under the impression that snails defended themselves mostly with their calciferous shells, and that otherwise they were pretty vulnerable creatures. That changed when I ran across an interesting encounter between a pulmonate snail and a predatory ground beetle (Carabidae: Anthiinae) in the rainforest of Atewa plateau in southeastern Ghana. I did not see the very beginning of the encounter, but I imagine that the beetle attacked the snail, naively expecting no resistance other than a feeble attempt by the snail to pull itself into the shell. But he was in for a nasty surprise. For the next 10 minutes the snail systematically engulfed the beetle in a copious amount of foamy mucus that effectively prevented the beetle from getting anywhere near the vital organs of the snail. In the end the snail simply slipped down the branch in a protective cocoon of foamy mucus, while the unfortunate beetle was barely able to walk away, frantically trying to clean the mucus off its head.
Turns out that these kinds of encounters are very common, and some carabid beetle have evolved strategies for paralyzing their snail prey before the mollusk is able to overwhelm the predator with mucus. Snails constantly produce relatively small amounts of mucus, which helps them slide on the substrate and prevents water loss. But when attacked, many terrestrial snails respond by blowing compressed air from the pulmonary cavity into a slit between the body wall and a fold of the respiratory orifice, while exuding extra amount of mucus. Of course every defense elicits anti-defense, and some carabid beetles have evolved the ability to paralyze the snail with a single bite to the head or posterior part of the mantle, thus stopping the production of the protective mucus foam.