How to get end position of a raycast

Should I check if the raycast hit something? then find the distance between the player and the raycast and place them on the distance ?