i don't know about physx but other physics engines like newton and bullet can cast rays with any of the supported convex collision shapes. not just as an actual ray without any thickness. this way the problem can be avoided but of course this also takes more performance.