It's not too bad with some clipping and coordinate calculations:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw[dashed, color=black!20] (0,0) circle(2.5);
\draw (0,0) circle(1) node {The Earth};
\foreach \x in {0,45,...,360} {
\filldraw[fill=white] (\x:2.5cm) circle(0.25cm);
\draw[fill=black] (\x:2.5cm)-- +(0,0.25cm) arc (90:-90:0.25cm) -- cycle;
}
% New Moon
\draw[fill=black] (0:3.5cm) circle(0.5cm);
\node at ($(0:3.5) + (0, 0.7)$) {\small New Moon};
% Waxing Crescent
\begin{scope}
\draw[clip] (45:3.5cm) circle(0.5cm);
\draw[fill=black] ($(45:3.5cm) - (0.25, 0)$) circle(0.5cm);
\end{scope}
\node at ($(45:3.5) + (0, 0.7)$) {\small Waxing Crescent};
% First Quarter
\begin{scope}
\draw[clip] (90:3.5cm) circle(0.5cm);
\draw[fill=black] (0, 3) rectangle (-0.5, 4);
\end{scope}
\node at ($(90:3.5) + (0, 0.7)$) {\small First Quarter};
% Waxing Gibbous
\begin{scope}
\draw[fill=black] (135:3.5) circle(0.5);
\draw[clip] (135:3.5) circle(0.5);
\draw[fill=white] ($(135:3.5) + (0.25, 0)$) circle(0.5);
\end{scope}
\node at ($(135:3.5) + (0, 0.7)$) {\small Waxing Gibbous};
% Full Moon
\draw (180:3.5) circle(0.5);
\node at ($(180:3.5) + (0, 0.7)$) {\small Full Moon};
% Waning Gibbous
\begin{scope}
\draw[fill=black] (225:3.5) circle(0.5);
\draw[clip] (225:3.5) circle(0.5);
\draw[fill=white] ($(225:3.5) - (0.25, 0)$) circle(0.5);
\end{scope}
\node at ($(225:3.5) - (0, 0.7)$) {\small Waning Gibbous};
% Last Quarter
\begin{scope}
\draw[clip] (270:3.5) circle(0.5);
\draw[fill=black] (0, -3) rectangle (0.5, -4);
\end{scope}
\node at ($(270:3.5) - (0, 0.7)$) {\small Last Quarter};
% Waning Crescent
\begin{scope}
\draw[clip] (305:3.5) circle(0.5);
\draw[fill=black] ($(305:3.5) + (0.25, 0)$) circle(0.5);
\end{scope}
\node at ($(305:3.5) - (0, 0.7)$) {\small Waning Crescent};
\end{tikzpicture}
\end{document}
For each phase I'm first drawing a circle at the correct point and using the clip
option which means that nothing outside of that circle (and in the same scope
) will be drawn. Then simply place a circle/rectangle on top filled in black.