this is, incidentally, why honeycomb desserts are possible. when you add baking soda to a hot sugar solution, you trigger a thermal decomposition reaction and evolve CO2:
2NaHCO3 + heat ---> Na 2 CO3 + H2O + CO2
the CO2 is released and causes all the bubbles and foaming.
edit: forgot to balance the stoichiometry