D. Rock, dust, and ice
Comets are primarily composed of ice (such as water ice, carbon dioxide ice, and other volatile compounds), dust, and rocky materials. This combination gives them a dirty snowball-like structure. When they approach the Sun, the heat causes the ice to vaporize, creating a glowing coma and often a tail.