Case 1: ray hits nothing.
Case 2: ray hits top of beam, going all the way to the bottom.
Case 3: ray hits top of beam, escaping through the side of it, continuing to 1 or 5
Case 4: ray hits side of beam, going all the way to the bottom.
Case 5: ray hits side of beam, escaping through the side of it, continuing to 1 or 5