4. From the 8 vertices of a cube, any 4 points $M, N, P, Q$ that do not lie on the same plane are chosen to form a dihedral angle $M-P Q-N$. Then the number of such dihedral angles of different sizes is ( ).
(A) 28
(B) 27
(C) 9
(D) 8
4. D.

Consider the cube $A B C D-A_{1} B_{1} C_{1} D_{1}$, which can be divided into the following three categories based on the edge of the dihedral angle:
(1) Taking the edge of the cube as the edge of the dihedral angle (let's take $A B$ as the edge of the dihedral angle), there are 2 essentially different dihedral angles: $A_{1}-A B-C$ and $A_{1}-A B-C_{1}$, with sizes of $90^{\circ}$ and $45^{\circ}$, respectively.
(2) Taking the face diagonal of the cube as the edge of the dihedral angle (let's take $B C_{1}$ as the edge of the dihedral angle), there are 5 essentially different dihedral angles: $A-B C_{1}-B_{1}$, $A_{1}-B C_{1}-B_{1}$, $A_{1}-B C_{1}-D$, $A_{1}-B C_{1}-D_{1}$, and $B_{1}-B C_{1}-D$, with sizes of $90^{\circ}$, $\arccos \frac{\sqrt{3}}{3}$, $\arccos \frac{1}{3}$, $\arccos \frac{\sqrt{6}}{3}$, and $\pi-\arccos \frac{\sqrt{3}}{3}$, respectively.
(3) Taking the body diagonal of the cube as the edge of the dihedral angle (let's take $A C_{1}$ as the edge of the dihedral angle), there are 2 essentially different dihedral angles: $A_{1}-A C_{1}-D$ and $A_{1}-A C_{1}-D_{1}$, with sizes of $120^{\circ}$ and $60^{\circ}$, respectively. In summary, there are 8 dihedral angles of different sizes.