Green's functions for open-shell atoms and molecules