How do I get the position of the bounces when I use raytracing?

I want to simulate light beams crossing the scene and adhering to geometrical optics. I do assume that the raytracer/pathtracer is the right instrument to do it.
My understanding is that the raytracer bounces the light off objects time and again to actually be able to see reflections. Now I would need to know the positions of the points where the light bounces off respectively the distances between them. If possible it would also be good to know how much of an impact each bounce has on the final pixel colour.

I think the information must be stored in some buffer, do you have any idea on how to extract the information?

By the way, I am using the c++ api.

Thank you.