Abstract-- This paper presents a new algorithm for maximizing the flight duration of a single UAV (Uninhabited Air Vehicle) and UAVs group using the thermal model developed by Allen at NASA Dryden. As a first step, we suggest a new algorithm based on Simultaneous Perturbation Stochastic Approximation for quick and precise detection of the center of a thermal updraft where the vertical velocity of the air stream is the highest. The method takes into account the unstable behavior of the updraft dynamics and the drift of its center in time. Then, a multi-agent system for joint flight of multiple UAVs is presented. A protocol for UAV communication providing effective information exchange on updrafts locations is proposed. A sufficient condition for the protocol to be effective is deduced theoretically. We show that the energy consumption of each UAV can be significantly reduced using the multi-agent approach.