How to send a raycastHit to another script?

Say I’m wanting to do something to an object that is hit by a raycast. But the raycasting and what happens when hit are done in two separate scripts. How would I send that raycast hit-point to the script that needs it?

I know there’s SendMessage, but wouldn’t that be a big performance hit to send a message every time there is a raycast hit? Would extending one of the scripts work?

Assuming the script you want to access is on the object hit by the raycast this is how you can access it:

RaycastHit hitInfo;
    // use the version of raycast you need, but it needs to include the hitInfo
if (Physics.Raycast(ray, out hitInfo)) 
   ScriptName otherScript = hitInfo.collider.gameObject.GetComponent<ScriptName>();
   if(otherScript != null)