I am going through the same learning curve, so I am no expert....but, if I can explain my understanding, maybe we can learn together. The amount of CO2 that gets absorbed into the beer is a function of pressure and temperature, so for any given pressure and temperature, only so many volumes of co2 will be absorbed in the beer. There are a number of sources that give you a chart for temp versus pressure, but one of the best resources is the Brewer's Association Draft Quality Manual (it is on this site or the BA one). When the beer leaves the keg, the CO2 rushes to leave the beer because the pressure outside of the keg is less than the pressure inside the keg. At the same time, the beer that was in the keg also starts to warm as it leaves the keg. In my system it needs to cool down the shank and the faucet.
The pressure in the keg is equal to the pressure set by the regulator (as the CO2 is absorbed in the beer). When the faucet is opened the beer flows as the pressure escapes from the keg. As it is escaping from the keg, it also is escaping from the beer. The length and type of the hose is used to counter this pressure coming out of the keg and beer and in effect slow it down. So for every type of beer hose, there is a resistance factor. For 3/16" beer line (the stuff I use and is common for us homebrewers with short runs), the resistance is somewhere between 2 and 3 psi per foot of hose. So, if you are carbonating and serving beer at 15psi, you would need somewhere in the order of 5 to 7 foot of hose to balance the system. Too short a hose, and all you will ever get is foam, too long of a hose and the flow slows down to a trickle and stops altogether at some length.
You also need to take into account the height of your faucet above the level of the beer (0.5 psi per foot of height of faucet over beer, or measure an average from the center of your keg). Also altitude plays a role. It takes an additional 1 psi per 2,000 feet of elevation to maintain the pressures in the kegs (I am at over 5,000 feet, so it makes a difference, but I am unsure if that adds hose or takes it away in the calculation..some expert please chime in).
So, the right length of hose will give you a nice pour based on all the variables discussed.
Also, it also occurred to me that the dynamics of my system changed just before my keg kicked (was empty). I was getting more foam at the end of the keg....not sure if that is a contributing factor for you.
I find that my system takes slightly more length of hose than I originally calculated, and improved when I bought a longer length and trimmed a foot at a time until it seemed good.
I hope I explained it accurately and perhaps was helpful. Good luck, and let us know how it turns out.