Microwave spectroscopy was used to probe the superfluid–Mott insulator transition of a Bose-Einstein condensate in a three-dimensional optical lattice. By using density-dependent transition frequency shifts, we were able to spectroscopically distinguish sites with different occupation numbers and to directly image sites with occupation numbers from one to five, revealing the shell structure of the Mott insulator phase. We used this spectroscopy to determine the onsite interaction and lifetime for individual shells.