I understand that I need to use compactness but somehow can't finish it.
Suppose $L$ is a language and $T$ a consistent $L$-theory with only finitely many logically inequivalent complete extensions. Show that there are $L$-sentences $\sigma_1, ..., \sigma_n$ such that every complete extension $T' \supseteq T$ is equivalent to one of $T \cup \{\sigma_i\}$.
My initial idea was to assume the opposite: for any $L$-sentences $\sigma_1, ..., \sigma_n$ there is a complete extension $T' \supseteq T$, such that $T' \neq T \cup \{\sigma_i\}$ for all $i.$
Here's an argument using completeness.
Let $T_1,\ldots,T_k$ be the complete extensions of $T$. Since they're distinct and complete, for each $T_i$ there are formulas $\sigma_{i,1},\ldots,\sigma_{i,_k}$ such that
$T_i\vdash \bigwedge_{j=1}^k\sigma_{i,j}$, but
$T_j\vdash\neg \sigma_{i,j}$ for all $j\neq i$.
Put $\sigma_i=\bigwedge_{j=1}^k\sigma_{i,j}$. Then $\mathcal M\models T\cup \{\sigma_i\}$ only if $\mathcal M\models T_i$. So by the completeness theoreom, $T\cup \{\sigma_i\}\vdash \sigma$ for all $\sigma\in T_i$. So $T_i$ is equivalent to $T\cup\{\sigma_i\}$.