[C#] Raycasts and Object Tags

I have this code that cast three rays in font of an ai to check if there if something there. then if something is there.

Physics.Raycast(transform.position, left, out lhit, StayD);
Physics.Raycast(transform.position, fwd, out hit, StayD);
Physics.Raycast(transform.position, right, out rhit, StayD);
if(hit.collider.tag == CTag && lhit.collider.tag == CTag && rhit.collider.tag == CTag)
 transform.Translate(Vector3.forward * Time.deltaTime * MoveSpeed);

this code was intended to make the ai move forward if the object in front of it has the same tag as the string CTag, and not move if any other object is infront of it, and move when there is nothing infront of it. i am not sure of how to do this, can any one help me.

i resolved managed to solve my problem by using a layer mask.
scroll down to casting raycasts selectively.