Raycast Mouse Position To vector3

so I am trying to do a raytrace position, to wherever my mouse is at the given second.
I am kind of a noob so I do not know where to start.
I want the ray to get the mouse position, and mark it in a vector3.
I want a spawned projectile to move towards the raytraced position
anyone have any ideas?

You have to use the Physics.Raycast

In the scripting reference, you can fin the 4th overload for the function that has a usage example.

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 100))
   Debug.DrawLine(ray.origin, hit.point);

From what I understand, hit.point contains the position you want your projectile to move towards.