Photon correlation in resonance scattering-a new approach to the investigation of the excited states of atoms and molecules