Confusion with notion $\operatorname{Spec}((k(p))\otimes_A B)$ I read this notion from Atiyah-Macdonald exercise 3.21:

$f:A\to B$ is a ring homomorphism. $f^*:\operatorname{spec}(B)\to \operatorname{spec}(A)$ is a mapping induced by $f$ and defined by $f^*(q):=f^{-1}(q)$ for $q \in \operatorname{Spec}(B)$. If $p$ is a prime ideal of $A$, deduce that the subspace $f^{*-1}(p)$ of $\operatorname{Spec}(B)$ is naturally homeomorphic to $\operatorname{Spec}(B_p/pB_p)=\operatorname{spec}(k(p)\otimes_AB)$, where $k(p)$ is the residue field of the local ring $A_p$

I have already proved that $f^{*-1}(p)$ is homeomorphic to $\operatorname{Spec}(B_p/pB_p)$. Let $S=A-p$, I can also get that
\begin{equation}
\begin{aligned}
B_p/pB_p&\cong A_p/p_p \otimes_{A_p} B_p\\
&\cong S^{-1}(A/p \otimes_A B)\\
&\cong A_p \otimes_A(A/p \otimes_A B)\\
&\cong (A_p \otimes_A A/p)\otimes_A B\\
&\cong A_p/p_p \otimes_A B. 
\end{aligned}
\end{equation}
What makes confused is that $k(p)\otimes_A B$ is just an $A$-modula while $\operatorname{Spec}(k(p)\otimes_A B)$ is defined by the set of all prime ideals of $k(p)\otimes_A B$. I don't know what ring structure should $k(p)\otimes_A B$ take here. Besides, when we take it as a ring, can we say that $k(p)\otimes_A B \cong B_p/pB_p$ because they are isomorphic as $A$-modula?
 A: $k(p)$ and $B$ are $A$-algebras, so $k(p)\otimes_A B$ inherits an $A$-algebra structure as well. In particular, it is a ring with $(a\otimes b)(a'\otimes b')=aa'\otimes bb'$.
If you are reading Atiyah-MacDonald's book, then go to page 30: Tensor product of algebras.
About the isomorphism $k(p)\otimes_A B \simeq B_p/pB_p$, I think it is a priori just an isomorphism of $A$-modules. I don't remember if it is proven at some point in the book, but you just need to check that the isomorphism is also an $A$-algebra morphism and I think you are done.
A: Question: "I don't know what ring structure should k(p)⊗AB take here. Besides, when we take it as a ring, can we say that k(p)⊗AB≅Bp/pBp because they are isomorphic as A-modula?"
Answer: If $\phi: A \rightarrow B$ and $\mathfrak{q}\subseteq B$ with $\mathfrak{q}\cap A:=\mathfrak{p}$, you get isomorphisms of rings
$$B\otimes_A \kappa(\mathfrak{p}) \cong B\otimes_A A_{\mathfrak{p}} \otimes_{A_{\mathfrak{p}}} \kappa(\mathfrak{p}) \cong$$
$$B_{\mathfrak{p}} \otimes_{A_{\mathfrak{p}}} \kappa(\mathfrak{p}) \cong A_{\mathfrak{p}}/\mathfrak{p}A_{\mathfrak{p}}\otimes_{A_{\mathfrak{p}}} B_{\mathfrak{p}} \cong B_{\mathfrak{p}}/\mathfrak{p}A_{\mathfrak{p}}B_{\mathfrak{p}} \cong B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}.$$
In particular is $\mathfrak{p}$ is a maximal ideal you get an isomorphism of rings
$$ \kappa(\mathfrak{p})\otimes_A B \cong B/\mathfrak{p}B.$$
Example: Let $A:=\mathbb{Z}, k:=A/(3)A \cong \mathbb{F}_3$ and $B:=A[x,y]/(x^3+y^3-2)$.
It follows $k\otimes_A B \cong k[x,y]/(f)$ where
$$f:=x^3+y^3-\overline{2} \cong (x+y-2)^3.$$
Whenever you have a map of rings $f:A \rightarrow R$ there is a canonical ring structure on $R\otimes_A B$ such that the canonical map
$$ R \rightarrow R \otimes_A B$$
is a map of rings.
