Are you using EP rated gear oil? If not, try it. EP (for Extreme Pressure) helps anti-foaming. Here's some other info I found:
Extreme Pressure Gear Lubricants
These lubricants are commonly referred to as EP gear oils. EP gear oils are petroleum based or synthetic blend based oils that contain special multi-purpose additive systems. The additive systems contain rust and oxidation inhibitors, EP additives, demulsifiers, antifoam agents, and in some cases solid lubricants that are collodially suspended, such as molybdenum disulfide, borates or graphite. The EP additive system, which includes sulfur-phosphorous, borates and sulfur-phosphorous-boron chemistries, provides a chemically protective film that protects against welding, scuffing and scoring of the gears during boundary lubrication conditions, which can occur at start-up, stopping and high shock loads. The EP lubricant grades correspond to ISO viscosity grades 68 to 1,500. EP gear oils perform well over a wide range of gear drive sizes and speeds in a temperature range of -15oC to 121oC .
Remember, air suspended in the oil will not support the pressures very well, compared to oil without air bubbles. In other words, if your oil foams, your gear teeth will wear out much faster. Good luck.......