I write a more self-contained solution for this problem.
Let $S_1,S_2 \in \mathbb{R}^{D\times d}$ be two matrices such that the their columns contain orthonormal basis for the subspaces $S_1$ and $S_2$, respectively. Denote the set of columns of $S_1$ as $V = \{v_1,\dots,v_d\}$ and $S_2$ as $U = \{u_1,\dots,u_d\}$.
Using Gram-Schmidt procedure, we can complete $V$ and $U$ to have a orthonormal basis for $\mathbb{R}^D$. Denote the resulting matrix as $A_1 \in \mathbb{R}^{D\times D}$ and $A_2 \in \mathbb{R}^{D\times D}$. Note that the first $d$ columns of $A_1$ and $A_2$ are equal to $S_1$ and $S_2$, respectively.
We make the following observation: $A_1^\top S_1 = \mathbb{I}_{D \times d} $ and $A_2^\top S_2 = \mathbb{I}_{D \times k}$ where $\mathbb{I}_{D \times d} \in \mathbb{R}^{D \times d}$ is matrix which contain identity matrix of size $d\times d$ on top and zero on the rest. More precisely,
$$
\mathbb{I}_{D \times d} = \begin{pmatrix}
1 & 0 & \cdots & 0 \\
0 & 1 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & 1 \\
0 & 0 & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & 0
\end{pmatrix}_{D \times d}
$$
Then, we claim that $R = A_2 A_1^\top$.
To show that $\text{col-span}(S_2)= \text{col-span}(R S_1)$, let $x \in \mathbb{R}^d$. Then,
\begin{align}
R S_1 x &= A_2 A_1^\top S_1 x\\
&=A_2 \mathbb{I}_{D \times d} x\\
&=S_2 x,
\end{align}
where the last line follows from $A_2 \mathbb{I}_{D \times d}=S_2$.
Finally notice that by definition it is straightforward to show that $A_2 A_1^\top$ is a unitary matrix.