The reduced-added Green's function technique in the quantum defect theory combines the advantages of analytical and ab initio methods in calculating frequency-dependent (dynamic) polarizabilities of atoms and molecules, providing an exact account for the high-excited and continuum electronic states. In the present paper this technique is modified to take into account the long-range dipole potential of a polar molecule core. The method developed is applied to calculation of the dynamic polarizability tensors of alkali-metal hydrides LiH and NaH as well as to some fluorides (CaF and BF) in the frequency range up to the first resonances. The results are in good agreement with ab initio calculations available for some frequencies.