How to find out a pixel's color at the collision point?

imagine a sphere colliding with a box, that has all of it’s faces textured in their own colors, how to I retrieve the color of that face?