We present a general theory for the Fano resonance in Anderson impurity systems. It is shown that the broadening of the impurity level leads to an additional and important contribution to the Fano resonance around the Fermi surface, especially in the mixed valence regime. This contribution results from the interference between the Kondo resonance and the broadened impurity level. Being applied to the scanning tunnelling microscopic experiments, we find that our theory gives a consistent and quantitative account for the Fano resonance lineshapes for both Co and Ti impurities on Au or Ag surfaces. The Ti systems are found to be in the mixed valence regime.