BackgroundThe nematode worm Caenorhabditis elegans, in which loss-of-function mutants and RNA interference (RNAi) models are available, is a model organism useful for analyzing effects of genes on various life phenomena, including behavior. In particular, RNAi is a powerful tool that enables time- or cell-specific knockdown via heat shock-inducible RNAi or cell-specific RNAi. However, conventional RNAi is insufficient for investigating pleiotropic genes with various sites of action and life stage-dependent functions.ResultsHere, we investigated the Ras gene for its role in exploratory behavior in C. elegans. We found that, under poor environmental conditions, mutations in the Ras-MAPK signaling pathway lead to circular locomotion instead of normal exploratory foraging. Spontaneous foraging is regulated by a neural circuit composed of three classes of neurons: IL1, OLQ, and RMD, and we found that Ras functions in this neural circuit to modulate the direction of locomotion. We further observed that Ras plays an essential role in the regulation of GLR-1 glutamate receptor localization in RMD neurons. To investigate the temporal- and cell-specific profiles of the functions of Ras, we developed a new RNAi method that enables simultaneous time- and cell-specific knockdown. In this method, one RNA strand is expressed by a cell-specific promoter and the other by a heat shock promoter, resulting in only expression of double-stranded RNA in the target cell when heat shock is induced. This technique revealed that control of GLR-1 localization in RMD neurons requires Ras at the adult stage. Further, we demonstrated the application of this method to other genes.ConclusionsWe have established a new RNAi method that performs simultaneous time- and cell-specific knockdown and have applied this to reveal temporal profiles of the Ras-MAPK pathway in the control of exploratory behavior under poor environmental conditions.Electronic supplementary materialThe online version of this article (doi:10.1186/s12915-015-0114-8) contains supplementary material, which is available to authorized users.