In most cases, this is due to improper drainage somewhere in the HVAC system. The best solution is to invest in routine, professional maintenance and inspection that keeps your drain lines and overflow pans clean, and prevents backups anywhere in the system.