The notions of Betti numbers and of Bass numbers of a finite module N over a local ring R are extended to modules that are only assumed to be finite over S, for some local homomorphism phi: R -\u3e S. Various techniques are developed to study the new invariants and to establish their basic properties. In several cases they are computed in closed form. Applications go in several directions. One is to identify new classes of finite R-modules whose classical Betti numbers or Bass numbers have extremal growth. Another is to transfer ring theoretical properties between R and S in situations where S may have infinite flat dimension over R. A third is to obtain criteria for a ring equipped with a `contracting\u27 endomorphism - such as the Frobeni...