Although all ideas are good here, sometimes I bleed some of the pressure off of the keg when using the beer gun to reduce foaming. For the short amount of time that the pressure will be reduced, it won't effect the carbonation of the beer significantly.
There are a lot of times when I bottle for competitions, I turn up the pressure on the keg a bit the day before to make sure that I can cap on foam. I then tuirn it back down after bottling and bleed off the extra pressure from the keg.
Just some additional thoughts.