Hi Walt,
I had the same problem with my corny kegs when using the Blichman Beer Gun, I had foam in my lines starting from the liquid-out posts. I tried changing the posts, changing the o-rings, changing the line length, chilling the line and beer gun, lowering the psi, and even buying new kegs, but all of this did not help with foam in the lines and excessive foam when filling bottles. I finally fixed the foaming issue when I installed carbonation stones with 2' of 1/4" beverage line attached to the end of the gas-in dip tube. I don't know why this fixed my foaming issue but now I can bottle with the beer gun at about 8-10psi and without chilling my bottles.