Spells as Sneak Attacks
Any spell that requires an attack roll and deals damage can be used in a sneak attack. In this case "damage" is normal damage, nonlethal damage, ability damage, or energy drain. You can sneak attack with a Melf's acid arrow spell, but not with a magic missile spell.
Ranged spells are effective as sneak attacks only at ranges of 30 feet or less (just like any other ranged sneak attack).
A successful sneak attack with a weaponlike spell inflicts extra damage according to the attacker's sneak attack ability, and the extra damage dealt is the same type as the spell deals. For example, a 10th-level rogue who makes a successful sneak attack with a Melf's acid arrow spell inflicts 2d4 points of acid damage, plus an extra 5d6 points of acid damage from the sneak attack (note that continuing damage from this spell is not part of the sneak attack). Spells that inflict energy drains or ability damage deal extra negative energy damage in a sneak attack, not extra negative levels or ability damage. For example, a 10th-level rogue who makes a successful sneak attack with an enervation spell deals 1d4 negative levels plus an extra 5d6 points of negative energy damage.
If the sneak attack with a weaponlike spell results in a critical hit, the damage from the spell is doubled but the extra sneak attack damage is not doubled (as with any sneak attack).
With spell effects that allow you to make multiple attack rolls, such as the energy orb spells or the Split Ray feat from Tome and Blood, you must treat the effect like a volley -- only the first attack can be a sneak attack.