Solve matrix equation $AX=0$

Suppose $A,X \in M_n(\mathbb{C})$ and $A$ is given. How do we find all solutions to $AX=0$? This was inspired by another question I just saw, and is out of curiosity mainly.

• The matrix $X$ is any matrix whose columns are all elements of the kernel of $A$, i.e. vectors $x$ such that $Ax=0$ – guestDiego Aug 19 '16 at 13:13
• @guestDiego so there's a $n-rank(A)$ dimensional solution space. Makes sense. Thanks :) – Shakespeare Aug 19 '16 at 13:15

Firstly, note that if $A$ is invertible, then the only solution is $X=0$.
In general, $AX=0$ means that the columns of $X$ are orthogonal to all the rows of $A$, i.e. belong to $\text{Ker}\,A$ (if $A_i$ is the ith row of $A$ and $X_j$ the jth column of $X$, this means $\forall i,j, A_iX_j=0$). Thus, the solutions are the matrices $X$ whose columns lie in $\langle A_1, \dots, A_n\rangle^{\perp}$.
For example, if $A=\begin{bmatrix}1&2\\3&4\end{bmatrix}$, a column $\begin{bmatrix}x\\y\end{bmatrix}$ of $X$ satisfies $x+2y=0$ and $3x+4y=0$.
In terms of linear maps, $AX=0$ means that the range of $X$ is contained in the kernel of $A$.