When the magnetic flux which travels through a coil varies, an electric current is generated in the latter which can light up a bulb. This phenomenon was discovered by Faraday. Click and drag the magnet.
If you want to study the phenomenon in a quantitative manner click here.