The photovoltaic effect, very similar in nature to the photoelectric effect, is the physical phenomenon responsible for the creation of an electrical potential difference (voltage) in a material when exposed to light. The photovoltaic effect in semiconductors permits the usage of solar cells as current-generating devices. While the photoelectric effect involves light photons knocking electrons out of a material completely, the photovoltaic effect involves photons from a light source knocking electrons only out of their atomic orbitals, but keeping them in the material; this allows them to flow freely through the material.
At the atomic level, electrons begin to act more like waves then particles. As the famous double-slit experiment shows, these waves can interfere, constructively or destructively, just like normal waves. We call the function that describes the amplitude of an electron the wave function; it is a function of position r and time t, and is denoted by the Greek letter Ψ.
From Ψ, we can obtain formulations for the physical properties of the electron such as energy, momentum, and position; as such, the wave function is said to describe the state of the electron.
The function Ψ(r, t) is determined by the potential energy function V(r, t). These two functions are related through the Schrödinger equation, a second order differential equation that can be solved for Ψ given V:
where Ψ is the wave function of the particle. These states describe the physical properties of the electron: its energy, momentum and position. The derivation and solving of the Schrödinger equation are not the subject of this text and are better left to a quantum mechanics text*; all we care about are the properties of the solutions.
The Schrödinger equation shows that, for an electron orbiting a nucleus, the states of the electron are quantized, meaning there are definite states that the electron can and cannot be in. For example, an electron may be able to have an energy of x, x+1, x+2, etc., but not x+0.5. The result of this is the existence energy levels (or orbitals), states of definite energy that electrons can reside in. Given enough energy, an electron can "jump" up into the next highest energy level, but it must get there all in one jump; it cannot jump halfw ay there twice. There are four distinct types of energy levels, denoted s, p, d, and f, with many possible states in each.
As an atom fills up with electrons, it fills from the states closest to the nucleus outwards. If an atom has many electrons, the outermost valence electrons are the only ones that undergo changes of state into different orbitals, since the inner electrons are "stuck" in between the nucleus and the valence electrons and hence have nowhere to go. The valence electrons cannot fill states that are already taken by the inner electrons, and so they can only take on higher states.