Electromotive force (emf) is the external work expended per unit of charge to produce an electric potential difference across two open-circuited terminals. The electric potential difference is caused by the presence of an electric field which separates positive and negative charges. The created electrical potential difference can drive current flow if a circuit is attached to the source of emf. Any method that creates an electric field, or separates charges creating an electric field, can be a source of emf. The most common methods are chemical reactions, thermodynamics, electromotive force, or radiation induced charge separation.
A battery is an example of a chemical reaction that stores separated charge. Molecules are held together by chemical bonds. The molecule in isolation is a stable entity, but when different molecules are brought together, some types of molecules are able to steal electrons from others, resulting in charge separation.
Thermodynamics forces an equilibruim to develop between any two materials brought into contact with each other. If the thermal energy is sufficient, electrons can be stripped from one material and transfered to another.
Electromotive force is a common technique for creating emf, as it takes mechanical energy and converts it into voltage using electromagnetic induction. Generators use this technique to produce electricity.
All light possesses energy, and this energy can be converted from one form to another, for example heat or voltage/current. Solar cells use this principle to capture incoming radiation, at which point an electron is forced loose from it's molecule. The electron is then captured by the solar cell, and contributes to the emf of the cell.