Spell Level: 3
Spell School: Transmutation
Casting Time: 1 Bonus Action (which you take immediately after hitting or missing a target with a ranged attack using a weapon)
Components: V, S
Range: Self
Area: None
Duration: Instantaneous
Conditions/Effects: Damage (Lightning)
Saving Throw: Dexterity
Ritual: No
Scaling: Spell Slot Level
Classes: Ranger
Link: Link to source
As your attack hits or misses the target, the weapon or ammunition you’re using transforms into a lightning bolt. Instead of taking any damage or other effects from the attack, the target takes 4d8 Lightning damage on a hit or half as much damage on a miss. Each creature within 10 feet of the target then makes a Dexterity saving throw, taking 2d8 Lightning damage on a failed save or half as much damage on a successful one.
The weapon or ammunition then returns to its normal form.
Using a Higher-Level Spell Slot. The damage for both effects of the spell increases by 1d8 for each spell slot level above 3.