When a person can't expel the lungs' fluid effectively, the fluid can be pushed out and into the airways when breaths are taken. The result is an excess of fluid and air mixing together, which creates a frothy foam. This foam, due to natural reflexes, can then be expelled through the mouth.