How to throw a RigidBody in the direction of Mouse Pointer (3D)?

Hello everyone, I need help!!
so I am creating a 3d game with bunch of obstacle(cubes) in it.
player will shoot a bullet(gameObject). Bullet will spawn at the position of player.
my main camera is like third person perspective.

now my problem is I can add force in forward direction, but I need to throw my bullet in the direction of my mousePointer.
How can I do it. If you want my scripts or screenshot of how my game looks like, please give me ur email and I will surely send.

Please Help!!

Camera cam;
Rigidbody r;
Vector3 direction = cam.ScreenPointToRay(Input.mousePosition);
r.AddForce(direction * 100);

Would just like to modify code shared by @qobion a bit.

Camera cam;
Rigidbody r;

//cam assignment
cam = GameObject.Find(“Main Camera”).GetComponent();

//As ScreenPointToRay return a Ray type, it is required to use Ray.direction to get Vector3 direction

Vector3 direction = cam.ScreenPointToRay(Input.mousePosition).direction;

r.AddForce(direction * 100);