Lightning (also known as Electricity and Thunder) is a recurring element in the Sonic the Hedgehog series. It acts most commonly as hazards in industrial 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 video games. 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 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.
Sonic Rivals series
In Sonic Rivals and Sonic Rivals 2, Lightning is used as one of the game's elemental Power-Ups. When used offensively, it will remotely zap the target and paralyze them in place. When used defensively, the effect is the same, although it is implemented via a few decoy Rings 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 in attacks such as Sonic and Shadow’s Atomic Strike. Robots, N'rrgal and Zoah are are resistant to lightning while Kron, Voxai and other organic enemies are weak against it. Chao named Knickt can shield the player with a Lightning-based shield, protecting them from damage.
Sonic Forces: Speed Battle
In Sonic Forces: Speed Battle, Electric is an elemental effect which the Electro Boost, Lightning, Moto-Bug and Storm Cloud Items use to hinder their opponents. When hit by an Electric attack, hit players become momentarily paralyzed, lose some Rings. In addition, hit players will also drop one of their stored Items at random and cannot use it (represented by that Item being shocked and covered in dark purple smoke before disappearing).