This form of special attack (supernatural or spell-like ability) works like a ranged attack (see Aiming a Spell, page 175 of the Player's Handbook). Hitting with a ray attack requires a successful ranged touch attack roll, ignoring armor, natural armor, and shield and using the creature's ranged attack bonus. Ray attacks have no range increment. The creature's descriptive text specifies the maximum range, effects, and any applicable saving throw.
|