They suck up little bits of air and then spit it out... I imagine something in the saliva must make it stay as bubbles. Some other types of fish make bubble nests too, hoplo catfish being among them. If you watch your betta long enough, you should catch him doing it... it's pretty cool, he'll spit out 2-3 bubbles at a time, then go back up and suck in some more air.