Electric (plug-in) cars will primarily draw their energy from the electric power grid, instead of gasoline. A recent article published at the IEEE Spectrum raises concerns that electric power grid may not be as "green" as we think.
However, we should remember that one big advantage of the electric car is about "alternative" energy. There are many ways that you can generate electricity: solar, wind, geothermal, nuclear, coal, etc. Some of them may or may not be eco-friendly. But at least people have a choice. If you like, you can replace old fashioned power generators with more environmentally friendly ones.
Going forward, green energy may not be the most important aspect of electric cars. A bigger factor that may determine their success (or failure) will be how economical they are compared to old-fashioned gasoline cars, and how much support can government (or the public sector) can help to accelerate their development.