Raycast between mouse and object

Hello guys I’m doing a 2D game and I want to apply a force on an object that is opposite of the mouse position.

I think the best way to do this is use Raycast2D because I’m working with sprites.

See my image of example

I’m having trouble to understand ray2d and I’m having trouble with this
See my code:

using UnityEngine;
using System.Collections;

public class MoveBall : MonoBehaviour 
{
	void Update()
	{
		
		Vector3 v = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position;
		Ray2D ray = new Ray(transform.position, v);			
			
			if(Input.GetMouseButton(0))
			{
			
			}
		

	}
	
}

I’m getting:
error CS0029: Cannot implicitly convert type UnityEngine.Ray' to UnityEngine.Ray2D’

How can I do that and if raycast is not the best choice have another way ?

You can get the direction vector for the force to apply by subtracting your mouse position from the position of your object and apply force in that direction.