The foam is coming out of your car vents because the air conditioning system may be over-cooling the air. This can cause the water in the air to turn into foam, eventually evaporating. To fix this, you can adjust the temperature on your AC system or add some stop leak to your radiator.