This work is based on a numerical study using the Monte Carlo code Geant4 of an X-ray exposure of a human head containing a tumor at the center. Our principal goal was to investigate the effect of inserting nanomaterials into the tumor on the absorbed dose. Gold is the most popular nanomaterial used in nanomedicine. In our simulation, we also focused on the other nanomaterials platinum, gadolinium and silver. Our results show that gold and platinum increase the absorbed dose in the tumor by up to 55%; the most suitable X-ray energy is between 20 keV and 140 keV. Both of these nanomaterials present the same advantages in X-ray therapy. Moreover, gadolinium increases the absorbed dose by up to 50%, while silver increases the absorbed dose by up to 20%. However, for both of these nanomaterials, the best X-ray energy to use is between 20 keV and 80 keV.