On a short day hike, fresh fruit can be a welcome treat that will hydrate you and provide fructose. For longer hikes, fruit can add more weight to your pack than you might like. Try apples or oranges. They have tough enough skins to travel well. Avoid soft fruits such as peaches, pears or bananas.
Energy bars provide plenty of protein and usually have enough sodium to replace the electrolytes that you are losing in the heat. They travel well, are non-perishable and are easy to throw in your pack or even your back pocket. Avoid bars that are chocolate-coated because they will quickly become a melted mess in the heat. Also, look for bars that are low in sugar.
For longer, overnight hiking trips you may want to bring along some more traditional meals. Find foods that use as little water as possible. Noodle cups are a good choice--they use little water and waste none of it. If you are hiking a great distance or over the course of several days, make sure to bring plenty of meals. According to the rangers at the Grand Canyon, in hot weather you will need to consume two or three times your normal food intake in order to provide your body with the energy needed to hike.
To maintain energy, eat small snacks of complex carbohydrates throughout the day. Have a few crackers, or some bread or grains every half hour or so. Foods with a lot of protein or fat can upset your stomach in the heat and take a long time to digest. Carbohydrates will give you energy without making your body work overtime.
Foods to Avoid
Avoid perishable food unless you plan on eating it during the first hour or so of hiking. Foods that may melt, such as chocolate, are a bad idea as well. Food that provides nothing but empty calories will just add weight to your pack and won't be of any benefit to your body, so leave the gummy bears at home.