Possible to us RayTracing instead of Linetrace?

I want to query a surface’s position and colour.
Is it possible to use gpu raytracing for this, instead of using a physics linetrace?

If so id be grateful for suggestion of where to find example code.