Hit enemy life with raycast

This is part of the code of my bullet that take enemy life, but it gives me an error:

Type UnityEngine.Component' does not contain a definition for health’ and no extension method health' of type UnityEngine.Component’ could be found (are you missing a using directive or an assembly reference?)

Script:

if(Physics.Raycast(rayAim, out hit, range)){
			
			
			if(hit.collider.gameObject.tag == "Enemy") {
    			hit.collider.GetComponent("EnemyScript").health --;
			}
		}

(I have no variable on bullet script, but i have health variable on enemyscript)

Looks like c# because of the out hit. So you should use a type safe syntax e.g.:

EnemyScript enemy = hit.collider.GetComponent<EnemyScript>();
if(enemy != null) //null check could be useful
{
    enemy .health--;
}