See the RSL rayinfo() function in the RenderMan documentation.

RenderMan Ray Information