Although it is acknowledged that genetic variation contributes to individual differences in thermotolerance, the specific genes and pathways involved and how they are modulated by the environment remain poorly understood. We link natural variation in the thermotolerance of neural function and behavior in Drosophila melanogaster to the foraging gene (for, which encodes a cGMP-dependent protein kinase (PKG)) as well as to its downstream target, protein phosphatase 2A (PP2A). Genetic and pharmacological manipulations revealed that reduced PKG (or PP2A) activity caused increased thermotolerance of synaptic transmission at the larval neuromuscular junction. Like synaptic transmission, feeding movements were preserved at higher temperatures in larvae with lower PKG levels. In a comparative assay, pharmacological manipulations altering thermotolerance in a central circuit of Locusta migratoria demonstrated conservation of this neuroprotective pathway. In this circuit, either the inhibition of PKG or PP2A induced robust thermotolerance of neural function. We suggest that PKG and therefore the polymorphism associated with the allelic variation in for may provide populations with natural variation in heat stress tolerance. for's function in behavior is conserved across most organisms, including ants, bees, nematodes, and mammals. PKG's role in thermotolerance may also apply to these and other species. Natural variation in thermotolerance arising from genes involved in the PKG pathway could impact the evolution of thermotolerance in natural populations.