I did a quick search and came across a few people with a similar question -- most reponses suggested some kind of infestation. (Here's an example from
http://www.arboristsite.com/showthread.php?t=578):
We have a mixture of several types of trees in our backyard, however most are pine trees. Two of the pines have a yellowish foam-like substance on the bark (dripping down trunk). Please help identify the foam and advise of any treatment we should pursue. Could it be harmful?
Regards.
John
My guess would be pine sap dripping, most likely from wounds caused by pine beetles or some other wood boring critter:alien: . If this is the case, the infested trees need to be removed immediately and the debris properly disposed of to prevent the spread of the bugs. I don't know your location, but I know that there is a bad infestation of pine beetles in the eastern and southeastern US right now.
John,
Your description of the foam sounds like a symptom of the spittlebug. It produces a foamy substance to keep itself moist and to hide from enemies. If it is borers as Brian suggested, the sap will be very sticky, whereas the foam from spittlebugs is not sticky.
Use of an insecticidal soap or horticultural oil will control spittlebugs without killing their natural predators.