[step:Prove the cohomology statement by applying $\operatorname{Hom}_R(\cdot, M)$]
We apply $\operatorname{Hom}_R(\cdot, M)$ instead of $\cdot \otimes_R M$. Since $B_{n-1}$ is free (hence projective), the short exact sequence $0 \to Z_n \to C_n \to B_{n-1} \to 0$ splits, and applying $\operatorname{Hom}_R(\cdot, M)$ yields the exact sequence
\begin{align*}
0 \to \operatorname{Hom}_R(B_{n-1}, M) \to \operatorname{Hom}_R(C_n, M) \to \operatorname{Hom}_R(Z_n, M) \to 0.
\end{align*}
The cochain complex $C^n(X; M) = \operatorname{Hom}_R(C_n, M)$ has cohomology $H^n(X; M) = \ker(d^n) / \operatorname{im}(d^{n-1})$. By the same splitting argument, $\ker(d^n) = \operatorname{Hom}_R(Z_n, M)$ and $\operatorname{im}(d^{n-1}) = \operatorname{Hom}_R(Z_n, M) \cap \{f : f|_{B_n} = 0\}^\perp$. More precisely, the image consists of those homomorphisms $Z_n \to M$ that factor through $Z_n/B_n$.
Since $H_n(X; R) = Z_n / B_n$ is free, the sequence $0 \to B_n \to Z_n \to H_n(X;R) \to 0$ splits, and applying $\operatorname{Hom}_R(\cdot, M)$:
\begin{align*}
0 \to \operatorname{Hom}_R(H_n(X;R), M) \to \operatorname{Hom}_R(Z_n, M) \to \operatorname{Hom}_R(B_n, M) \to 0.
\end{align*}
By the same analysis as the homology case, $H^n(X; M) \cong \operatorname{Hom}_R(Z_n, M) / \operatorname{Hom}_R(B_n, M)' \cong \operatorname{Hom}_R(H_n(X;R), M)$, where the quotient identifies homomorphisms $Z_n \to M$ that agree on $B_n$ with homomorphisms $H_n(X;R) \to M$.
More directly: the restriction map $\operatorname{Hom}_R(Z_n, M) \to \operatorname{Hom}_R(B_n, M)$ is surjective (by the splitting), so its kernel is exactly $\operatorname{Hom}_R(Z_n/B_n, M) = \operatorname{Hom}_R(H_n(X;R), M)$. Since $\operatorname{im}(d^{n-1})$ corresponds to the image of $\operatorname{Hom}_R(B_n, M)$ in $\operatorname{Hom}_R(Z_n, M)$ (via the splitting), we get
\begin{align*}
H^n(X; M) \cong \operatorname{Hom}_R(H_n(X; R), M).
\end{align*}
[/step]