In the last years, and thanks to improvements on computing and communications technologies, wireless networks formed by vehicles (called vehicular networks) have emerged as a key topic of interest. In these networks, the vehicles can exchange data by using short-range radio signals in order to get useful information related to traffic conditions, road safety, and other aspects. The availability of different types of sensors can be exploited by the vehicles to measure many parameters from their surroundings. These data can then be shared with other drivers who, on the other side, could also explicitly submit queries to retrieve information available in the network. This can be a challenging task, since the data is scattered among the vehicles belonging to the network and the communication links among them have usually a short life due to their constant movement. In this paper, we use mobile agent technology to help to accomplish these tasks, since mobile agents have a number of features that are very well suited for mobile environments, such as autonomy, mobility, and intelligence. Specifically, we analyze the benefits that mobile agents can bring to vehicular networks and the potential difficulties for their adoption. Moreover, we describe a query processing approach based on the use of mobile agents. We focus on range queries that retrieve interesting information from the vehicles located within a geographic area, and perform an extensive experimental evaluation that shows the feasibility and the interest of the proposal.