How to get RayCast position of mouse

How do you get the position on a terrian of a ray point.

Like if I shoot a wall, a line is made from my mouse position to the point where my line intersects a object.
Hope that makes sense.

http://www.google.com/search?&q=site://unity3d.com+raycast+position+mouse+terrain

I am trying to make a building feature in game, where they click the object they want to instantiate and a object is instantiated at the position of the mouse (hit.point) and follows your mouse point on the terrian then if they click again the object position is where you clicked.

When I tried to use the hit.point the object kept starting where I pointed and then moved towards me…