When current flows through a very tiny filament, it heats up to a very high temperature because of the electrical resistance. This causes the filament to burn brightly and, thus, the light bulb in the flashlight glows.