Some good references are:
Brewing Network Archive
http://www.thebrewingnetwork.com/archiv ... -24-05.mp3
Web Page
http://ceisites.com/balance.html
Basically, there are two things you need to worry about: the carbonation of your beer and the correct velocity of your beer as it goes through your beer tap so it does not foam.
The problem you have is that your system is not balanced to achieve both items listed above. When your system has the correct pressure to get the right amount of carbonation in your beer it foams out the tap. And when your system has the correct pressure to pour properly it does not maintain the correct carbonation in your beer.
Ideally, you want to set your pressure to get the correct amount of carbonation based on the type of beer and the temperature the beer is being stored at (most beer books have charts for this or promash can give you the information). This is because your beer wants to be at equilibrium with its environment. Given varying amounts of temperature and pressure of CO2, your beer with be at equilibrium with different amounts of dissolved CO2 in your beer. By lowering the pressure on your beer you caused it to be come in equilibrium with its environment by lowering the amount of dissolved CO2 it has.
Now the pressure required to keep your beer carbonated properly in the keg will often force to beer to have a turbulent flow (think of a river through a set of rapids) as it goes through your beer tap and that causes foaming. So you want to have less pressure at your tap to make sure your beer has laminate flow (think of a river moving calmly). This is achieved by reducing the energy (kinetic and potential) of your beer as it makes its way from your keg to your tap. In fluid mechanics classes this referred to as “head loss†(it has nothing to do with beer head, but rather refers to energy loss in units of elevation based potential energy) and is based on Bernoulli’s theorem with added friction losses if you want to study further.
So what you want to figure out is how to achieve this “head lossâ€. The first “head loss†is achieved though the height difference from the top of your beer to the center of your tap (it is the top of your beer, but as the top of your beer changes as you empty the keg I would suggest you use an average by using center of your beer when your keg is full). Simply, the larger the difference between your tap and your keg the more "head loss" happens. The other “head loss†you need to think about is the friction losses of your beer lines. Again simply, the longer your line the more “head loss†happens.
The link I gave you above is an over simplification of Bernoulli’s equation. It is not accurate from an engineering standpoint but is accurate enough for home kegging. Basically if you are using 3/16†beer line, the length of line needed to cause the “head loss†is:
L = (P– H*0.5)/2.7
Where:
L = Length of beer line required
P = pressure in your keg as read off your regulator
H = height difference between the center of your beer in a full keg and your tap
Hope this helps you out.