If you could fill in the following blanks we could help you out with this.
Regulator pressure?
Beer line inside diameter?
Beer line length?
There is a balance between line size, length, and pressure.
You need the right pressure for the level of carbonation you want, but you don't want that same pressure at the tap.
Physics come into play with line length and diameter to reduce the pressure at the tap.
My personal setup is as follows, which works for most styles of beer that I brew (mainly IPA's)
Regulator pressure approximately - 12 PSI
Beer line diameter - 3/16" (approx 5mm), recommend a fairly heavy wall thickness on the tubing)
Beer line length - 10 feet (3 meters)
There is a chart for this here on Brewers Friend, not sure where, but someone will direct you to it if you can't find it.
There is another factor that can cause foaming, that is the temperature of the tap itself, and your glass as well.
Warming of the beer when pouring will cause foaming, a longer shank inside your keg fridge will help.
I like to keep glasses in the same fridge that I pour from so that the glass and the beer are roughly the same temperature.
Hope this helps!