Casting a ray from empty game object but did'nt know how to get the name of game object infront of the ray ?

Here is my code of casting a ray from game object.
i know it will be pretty simple but but now this time i am stuck in there.
using UnityEngine;

public class castray : MonoBehaviour
{
void FixedUpdate()
{
Vector3 fwd = transform.TransformDirection(Vector3.forward);

	if (Physics.Raycast(transform.position, fwd, 10)) 

	Debug.DrawRay(transform.position, fwd, Color.green);
}

}

thanks in advance.

public class castray : MonoBehaviour {
void FixedUpdate() {
Vector3 fwd = transform.TransformDirection(Vector3.forward);
RaycastHit hit;

			if (Physics.Raycast(transform.position, out hit, fwd, 10)) {
				Debug.DrawRay(transform.position, fwd, Color.green);
				print(hit.collider.name); //prints hit gameobject's name
			}
		}
	}