Vertical heterogeneity in the physical characteristics of lakes and oceans is ecologically salient and exploited by a wide range of taxa through diel vertical migration to enhance their growth and survival. Whether analogous behaviors exploit horizontal habitat heterogeneity in streams is largely unknown. We investigated fish movement behavior at daily timescales to explore how individuals integrated across spatial variation in food abundance and water temperature. Juvenile coho salmon made feeding forays into cold habitats with abundant food, and then moved long distances (350–1300 m) to warmer habitats that accelerated their metabolism and increased their assimilative capacity. This behavioral thermoregulation enabled fish to mitigate trade-offs between trophic and thermal resources by exploiting thermal heterogeneity. Fish that exploited thermal heterogeneity grew at substantially faster rates than did individuals that assumed other behaviors. Our results provide empirical support for the importance of thermal diversity in lotic systems, and emphasize the importance of considering interactions between animal behavior and habitat heterogeneity when managing and restoring ecosystems.