The height of the stack of cubes is 6, and the diagonal along the base, a square with sides of length 3, is 3√2 (using Pythagoras, or 45-45-90 triangle ratios). The long sloping line cutting through all three boxes in the diagram is just the hypotenuse of a right triangle with those two short sides. So if the length of the long sloping line is d, we have
d^2 = 6^2 + (3√2)^2
d^2 = 54
d = 3√6
By similarity, 1/6 of that line will be in the top box, 2/6 will be in the middle box, and 3/6 of it will be in the bottom box. We want the part in the middle box, so the answer is (2/6)(3√6) = √6. Technically, you also need to confirm the entire blue line is contained in the middle box, since that's all the question asks for, but it is, which you can confirm by using slopes.
nick1816 -- my solution differs from yours; it appears you got 3√3 for the diagonal of the base of the bottom cube, instead of 3√2? edit: I see you already caught the mistake!
_________________
now teaching gmat focus
ianstewartgmat.com