From Dark and Darker Wiki

< Ray of Darkness

((((12 (base dmg) + Magical Damage from Staff/Book/Orb) × (1+ Magical Power + Perks)) + Additional damage) × body multiplier(its always 1 cause RoD doesn't register limbs or headshots)) per second.

So lets say I have a purple staff (10 magic damage), Soul collector fully stacked (60% extra dark magic damage), 40% magical power bonus and +2 magical damage;

The formula would look like this -> (((12 + 10) × (1 + 0.4 + 0.6)) + 2) = 46 damage per second which if it hits for the entire duration is 230 damage in 5 seconds (also keep in mind magic resistance, this is the damage on a target with 0% magic res). On a cleric with base magic resist (14.9%) it would deal around 195.5 total or 39 DPS.