How is the damage done from the PSI - Rift ability calculated?
I assume you mean Rift ability? It is only one that seems to match your description.
Anyway, the damage is calculated by taking the casters Will score and the targets Will score and deducing targets score from casters and using remainder to see how much damage is done.
Unless my own studies are wrong, it deals base damage of 4 and then additional +1 for every 5 Will left after deducting victims Will from users Will.
This means, that targets with low Will (such as Mutons and especially robotics) suffer a lot, but units with very high will will suffer less.
As such, for example, if the caster has 100 will and opponent has 80, then when the rift hits it's going to do 4 + (100-80)/5 = 4 + 20/5 = 4 + 4 = 8 damage.
tl;dr
Less Will the target has, more damage it takes.
I try to see if I can find the exact math from the game files, but I doubt it. If anyone has the exact formula, feel free to say it.