Raycast From Within An Object

I am having a problem with raycast detecting a collision from within another object. For example I have a large box object and within it is a smaller box object. I want to fire a raycast from the smaller box to detect the presence of the larger box. At the moment the raycast is firing perfectly and can detect the larger box when the smaller box object is outside the larger one but fails from within. Is it possible to do what i want to do? Anyone got any ideas?

Many thanks to all those that can help

If you are using a standard cube, it has 6 sides (12 triangles) which ‘face out’. So your ray will only hit triangles it can ‘see’, which, from within such a cube, you can’t see (they face out). So what I do is model a special cube that has inside and outside faces. Blender makes this easy.