Let f : A -> B be a ring homomorphism and let J be an ideal of B. In this paper, we Study the amalgamation of A with B along J with respect to f (denoted by A infinity(f) J), a construction that provides a general frame for Studying the amalgamated duplication of a ring along an ideal, introduced and studied by D'Anna and Fontana in 2007, and other classical constructions (such as the A + XB[X], the A + XB[[X]] and the D + M constructions). In particular, we completely describe the prime spectrum of the amalgamated duplication and we give bounds for its Krull dimension. (C) 2009 Elsevier B.V. All rights reserved.