- Due to the rise in environmental and economic limitations in today's world, the use of dispersed generation that often applies renewable energies, and electric vehicles is markedly increasing. On a large scale, either of these technologies can have damaging effects on the electricity grid; however, with proper energy management and programming, technologies, and energy storage resources can reduce these effects. Accordingly, the impact of the integrated aggregation of EVs to the grid for the charge/discharge process and the resulting grid instability, especially at the load peak time, is the main challenge usig of these vehicles. A challenge associated with these resources is their intrinsic uncertainty and stochastic scheduling. Herein, the stochastic scheduling of a power system in the presence of electric vehicles (EVs) and renewable energy sources (RESs) is solved via the optimization algorithm developed based on lightning search. The proposed model uses the probabilistic method to generate different scenarios for wind speed and solar irradiation coefficient; then, it modifies them via the scenario reduction method. In the proposed method, the conditional value at risk (CVaR) method is adopted to evaluate and manage the risk of the problem uncertainties. The use of the capacity stored in the EV batteries for overcoming the uncertainty of generation by wind and solar energy sources is also evaluated. Finally, the proposed method is tested on a modified sample system. The simulation results show that the power capacity stored in the vehicle-to-grid (V2G) stations greatly contributes to covering the uncertainty of wind and solar farms. The optimization algorithm is superior to other methods in local and global search.