In this paper, an algorithm , based on genetics and auxiliary nodes, to reduce energy consumption in wireless sensor networks has been presented. In this research, by considering some parameters as energy and distance, a target function has been created, which is more optimum comparing to other methods. In this research cluster head is selected by genetic algorithm. In RAWSN algorithm a new technique of replacing auxiliary nodes when some CHs ’energies come to an end, is presented. The results of simulation show that the number of alive nodes at the end of each round increases comparing to other methods and this has led to prolongation of network lifetime.