Let $\phi:A\to B$ be a ring homomorphism, where $A$ and $B$ are commutative rings. We know that if $q$ is a prime ideal in $B$, then $\phi^{-1}(q)$ is a prime ideal in $A$. Hence, there exists a mapping $\phi^{*}: \operatorname{Spec}(B)\to\operatorname{Spec}(A)$.
My book (Commutative Algebra by Atiyah and MacDonald, Problem 21 on page 13) then talks about $\phi^{*-1}:\operatorname{Spec}(A)\to\operatorname{Spec}(B)$. Why does this mapping exist? The image of a prime ideal under a ring homomorphism may not be a prime ideal, unless the mapping is surjective.
Your skepticism is justified; such a map does not exist, in general.
Perhaps your book is working in a case where $\phi^*$ is known to be bijective, or perhaps your book is speaking of $\phi^{*{-1}}$ of some subset of $\text{Spec}(A)$ (if $f$ is a map of sets $X \to Y$, then $f^{-1}$ makes sense as a map from the power set of $Y$ to the power set of $X$).