Materials are made up of atoms; an atom comprises a nucleus and a cloud of electrons surrounding it. In a solid, the atoms are so close to each other that the electron clouds overlap, and the electrons form a band of levels increasing in energy. In a metal, all the levels up to certain energy are full of electrons. Electric current is a flow of electrons. For the electrons to be able to flow in a solid material, they need to jump out of the highest full level (in which flow is blocked) to the next empty level above it.
Fortunately, in metal, the lowest empty level is close to the highest full level. Applying a small electric field to a piece of metal (for example, by connecting it to a battery) provides enough energy to make the electrons into the highest level they occupy jump into the nearest empty level just above, in which they can easily flow. Shining light onto material can also make the electrons jump into an empty level. In a metal, because the levels are very close to each other in energy, metals absorb light of all wavelengths. Another class of material is called a dielectric, in which there are no empty levels near the levels fully occupied by the electrons. Instead, there is a “forbidden gap”, and then, with increasing energy, again there are permissible levels. Because these levels are normally empty, no electrons are available to carry an electric current, hence this class of material is an insulator.
If the forbidden gap is rather small, at room temperature some electrons are able to jump across the forbidden gap into the normally empty levels, where they can carry an electric current. Such materials are called “semiconductors” — their electrical conductivity is lower than that of metals because they have fewer electrons able to move. Semiconductors are just dielectrics with small forbidden gaps.
Dielectrics are transparent to light whose energy is less than that of the forbidden gap. Many familiar dielectrics, such as quartz, are transparent until the ultraviolet region. The forbidden gap of silicon, the most widely used semiconductor, lies in the infrared region; therefore in the visible region silicon absorbs light and looks metallic.
An electron can be forced to jump across the forbidden gap by light. Any light that is absorbed will suffice. Such photoexcited electrons readily carry an electric current. This is the basis of a photodiode for detecting light — the current is proportional to light intensity — and photovoltaic cells for generating electricity from sunlight. These devices also work the other way round — applying a strong electric field to the material forces electrons across the forbidden gap, from which they then drop back, and as they drop they emit light. This is the basis of the light-emitting diode.