The Thermopile is a device that uses thermal differentiation to generate energy. Though the maximum possible energy output of a single unit is not as great as a solar panel, it does not require light, and so its use is not limited to daylight hours.
For a Thermopile to generate energy it must be placed adjacent to blocks of different temperature. Placing four water blocks on the sides of a thermopile and a lava block beneath it will generate the maximum possible amount of energy of any formation that does not require upkeep. Using ice instead of water with this formation will generate a greater output, but the heat from the lava will soon cause the ice to melt, thus requiring constant attention.
A Thermopile with one Lava gives ~0.12 Amp per Water. (0.49 if four Water)
Total output is boosted to 0.49 Amp if at least one of the sides has Ice or Snow. Ice and Snow melt with time. Ice and full Snow blocks turn into Water, non-full Snow (from snowing in a winter biome) just vanishes.
Replacing them too fast or simply having too much eventually cools Lava-Sourceblocks down and makes it turn into Obsidian. Flowing Lava seems to be much more resiliant against this, but eventually turns into Basalt Cleanstone.