In the affine case, let $X=Spec A$, $Y=Spec B$, and $Z=Spec R$. If you have morphisms $f:Z\rightarrow X$ coming from $\phi:A\rightarrow R$ and $g:Z\rightarrow Y$ coming from $\psi: B\rightarrow R$ (because $Aff$ is anti-equivalent to   
$CRing$), then the pushout $X \coprod_{Z} Y$, gluing $X$ and $Y$ along $Z$ is given by $Spec D$, where 

$D=A\times_{ R} B:=$  { $(a,b) \in A\times B | \phi (a)= \psi (b) $ } .