Cacti produce their food through photosynthesis that occurs in their pads, which are modified stems. Evolution has modified their leaves into spines that provide shade for the pads and break up the wind to reduce evaporation through the skin of the stems.
Producing food in the arid desert region is not easy for cacti. They use a modified form of photosynthesis scientists call CAM photosynthesis. This process allows them to open the pores in their leaves to collect the carbon dioxide necessary for converting sunlight into glucose. They then close these pores and store the carbon dioxide internally until sunrise.
Cacti also have specialized root systems that allow them to gather moisture quickly from the limited amount of desert rain. The root system is broad but shallow. In some cacti, the first few drops of rain trigger the growth of fine roots to improve the plant's ability to absorb and store moisture; these roots dry up later. A waxy layer on the surface of the pads helps reduce evaporation of water.
The temperature inside a cactus plant can reach 70 degrees Fahrenheit without damaging the plant. As colder weather arrives, the cactus stores less water, and the internal moisture is converted to a thick mucus-like substance that helps the plant survive the cold.