The layers in a particular gumball are (1) an outer layer of citric acid and malonic acid; (2) a layer of sugar and flavoring; (3) a layer of sodium bicarbonate ($NaHCO_3$); and (4) gum. When a person starts to eat one of these gumballs, they pucker, smile, and then foam at the mouth before starting to chew the gum itself. Where did the foam come from?