I can't find any material on collision detection between a ray and a box in any of my books. This means that it should be easy, but nothing comes to mind, any ideas?
Figure out how to compute the intersection between a ray and a plane. You can do it in such a way that the result is expressed in a frame of reference in the plane such that both coordinates will be between 0 and 1 precisely when the rectangular face has been hit. Now use that six times.