Perhaps the most famous novel written about alternative energy is Isaac Asimov's The Gods Themselves (Doubleday, 1972), where energy is generated by exchanging matter with an alternative universe, called the para-universe (for "parallel universe").
Arthur C. Clarke predicted the generation of electricity from the ocean in his 1962 short story "The Shining Ones," in which energy is from temperature differentials in ocean currents.
In the movie The Matrix, a band of humans fighting for freedom against the computers that have taken over the Earth live in Zion, an underground city. Zion is located at a depth where it can draw its energy from the heat of molten rock flowing nearby. The geothermal energy is sufficient to run a city with a population of approximately 250,000 people.
As for solar energy, James Gunn describes a solar energy project in his story "Child of the Sun" (1977), which deals with the development of an economical method of harnessing solar energy. An engineer in the story explains, "Energy can always be stored by pumping water, electrolyzing it into hydrogen and oxygen, with batteries or flywheels. The problem is economics: it's cheaper to burn coal, even if you toss in the cost of environmental controls and damage. Almost one-fourth as cheap. And nuclear power costs less than that. Other forms of solar power, including power cells for direct conversion of sunlight into electricity, are either less efficient or more expensive."