If a raycast hits a gameobject, how do i check who shot that raycast

I’m making a mulitplayer fps game with pun 2 free, and I want to know how to check who shot a raycast at a player when that player dies, so I can make some UI saying that this person killed this person. If a raycast hits a gameobject, how would I check who shot it?

First parameter in Raycast is origin position. You can use that.
Also Physics.queriesHitBackfaces=true can be set to detect collider of caster (if ray is casted from inside of collider). But then you have to use RaycastAll to get all hits (not only first one with caster).