Lightning (Also known by it's variations Electricity and Thunder) is a recurring element in the Sonic the Hedgehog series. It acts most commonly as hazards in fire themed stages, but has also occasionally served as power-ups and special moves.
Hazards and obstacles
Lightning and electricity usually appear as obstacles encountered throughout the various levels in the Sonic series. When a playable character makes contact with electricity without protection, the player will take damage. Having a Lightning Shield will protect the player from almost all these hazards.
Electric Generators are made to weaponized electricity through electric discharge. The machines usually charge and discharge it's electricity zapping anyone within vicinity of it's electrical reach. Badniks such as E-16 Electro Spinners are capable of defending themselves with electrical shields. Thunder Ball and certain Flapper are able to concentrate electricity towards directions like lightning.
Attack and Powers
In a few games, Lightning has been incorporated as a special power or gimmick that the player can use in conjunction with their attacks for more potency or as a separate power/powerup to enhance the player's performance.
In Sonic Rivals , Lightning is used as a power-up. When used offensively, it will create a ball of electricity that will track down the target and paralyze them in place. When used defensively, the effect is the same, although it is implemented via a Dummy ring that will only affect the target if they touch it.
Sonic Chronicles: The Dark Brotherhood
Lightning is one of the many elements featured in Sonic Chronicles: The Dark Brotherhood , though it does not have the same stunning/paralyzing effects of former games. It is used it attacks such as Sonic and Shadow’s atomic strike. Robots, N'rrgal and Zoah are are resistant to lightning (Zoah capable of electrical attacks) while Kron, Voxai and other organics are weak against it. Chao named Knickt can shield the player with a Lightning-based shield, protecting them from damage.