You can use indirect effects of spells however. Like using telekinesis to drop a boulder on them.
How would you rule on the spell Catapult from XGtE? I was thinking that the Catapulted object would get to the rakshasa and then drop harmlessly at it’s feet. Or would the object take damage but not the rakshasa? Or would the object just automatically miss?