Position before the camera?

In my script i use RaycastHit:

var hit : RaycastHit;
if(Physics.Raycast(transform.position,transform.forward,hit,100)){
Instantiate(prefab,hit.point,Quaternion.identity);
}

if it doesn’t hit other object i want to instantiate the prefab at the end of raycast. Is it possible?

var defPos = Vector3(transform.forward.x, transform.forward.y, transform.forward.z+100);

Instantiate(prefab, defPos, rot);

I don’t do JS so syntax might be a bit off

Instantiate(prefab,transform.position + transform.forward*100,transform.rotation);