Move object to raycasthit

This may be a basic question, but I am new to game development so please bear with me.

I am trying to make a projectile attack by spawning an object and trying to move it to the location where the raycast has hit but nothing seems to work. I would like to know how I could transform an object’s position to the location where the raycast has hit most preferably in Lua.