What type of smoker are you using?
Just off the top of my head and without any additional information like smoker temp, injected PBs vs non injected, "factory" injected with sodium phosphate solution, etc, etc. The foaming could be caused by the proteins from the meat reacting with the water and apple juice in your water pan.
For reference, using apple juice, beer, or what have you in the water pan is just a waste as it does nothing for flavoring the meat. You would be better off spritzing the PB instead if flavoring is your goal.