Get component from parent of children hittet with raycast

I have many chests placed on terrain from prefab. Every chest has animatior with animations. I want to get Animator component from chest which is hitted by raycast.

if (Physics.Raycast(ray, out rayCastHit, 5))
        {
            if (rayCastHit.collider.tag == "chest")
            {
                 Animator... //how to get component?
            }

The “chest” tag is children of object where the animator component is. How to get component from parent of children hittet with raycast?

Ok, did it:

if (rayCastHit.collider.tag == "chest")
             {
                   Animator = hit.collider.gameObject.GetComponentInParent<Animator>();
             }