Using Interfaces in Unity3D:
Check Youtube for other tutorials about interfaces and working in Unity3D. It’s a pretty powerful combination.
In your case, use GetComponent() to find the interface on the thing you hit with the raycast!