Final answer:
When a massive star runs out of hydrogen, its core contracts and heats, causing the outer layers of the star to expand and increase in temperature.
Step-by-step explanation:
When a massive star begins to run out of hydrogen to fuse, its core contracts and heats. As the hydrogen in the star's core is used up, the core contracts under its own weight, causing it to become hotter. This heat is then transferred to the outer layers of the star, causing them to expand and increase in temperature.