The blood builds up in the lungs, liver, legs, etc., and the increased vein pressure causes it to leak into the lungs and peritoneal cavity. This leads to coughing, and the dog coughs up a bubbly red fluid due to fluid retention in the smaller airways.