How to get the height of an object using raycast?

I want to get the height of an object that the raycast hit. What I can do?

Considering you know how to use Raycast and what is GameObject:

    RaycastHit hit;
    if (Physics.Raycast(rayOrigin, rayDirection, out hit, maxDistance))
    {
        GameObject hitObject = hit.collider.gameObject;
        //do whatever you want with your hit object, GetComponenets, position, size, etc.
    }