[step:Factorise $a$, $b$, and $pc$ into irreducibles using the UFD property]Since $R$ is a UFD and $a, b \in R$ are nonzero non-units (if either is a unit we handle this below), write
\begin{align*}
a &= u \, q_1 q_2 \cdots q_m, \\
b &= v \, r_1 r_2 \cdots r_k,
\end{align*}
where $u, v \in R^\times$ are units and $q_1, \ldots, q_m, r_1, \ldots, r_k$ are irreducible elements of $R$. (If $a$ is itself a unit, then $a = u$ with $m = 0$, and similarly for $b$.)
Then
\begin{align*}
ab = (uv) \, q_1 \cdots q_m \, r_1 \cdots r_k.
\end{align*}
This is a factorisation of $ab$ into irreducibles (with unit factor $uv$), since each $q_i$ and each $r_j$ is irreducible.
On the other hand, $ab = pc$. If $c$ is a unit, then $ab = pc$ with $p$ irreducible gives a factorisation with a single irreducible factor $p$. If $c$ is not a unit, write $c = w \, s_1 s_2 \cdots s_\ell$ where $w \in R^\times$ and each $s_i$ is irreducible. Then
\begin{align*}
ab = pc = w \, p \, s_1 s_2 \cdots s_\ell,
\end{align*}
which is another factorisation of $ab$ into irreducibles (with unit factor $w$), the irreducible factors being $p, s_1, \ldots, s_\ell$.[/step]