tomd seems to be talking about the hypotenuse of a triangle which is drawn on the (flattened-out) shape of the end walls (where the spider and the fly are at opposite ends) combined with the long wall, involving the spider having to walk 8 metres upwards. If that is the path followed by the spider it would indeed be a right-angle-triangle with vertical 8m and horizontal 50m, i.e the path would be the square root of (50 squared plus 8 squared) i.e. square root of 2564, i.e. 50.6 (ish).
But as Shrek2 says, it is not necessary for the spider to walk along the hypotenuse of a triangle, because the path from the spider to the fly on the flattened-out shape of the end-walls and the floor is a straight path of 50m which does not need to include any sideways element. Therefore the spider could walk 50 metres to get to the fly.
BUT
what nobody has yet mentioned is that the spider can in fact make the journey even shorter by jumping off the wall onto the floor before walking the length of the room. Therefore the journey is reduced to 49 metres; if however the spider is able to include an element of sideways propulsion in his jump off the wall onto the floor, he may land on the floor (for example) 30 cm away from the end wall, in which case the distance he has to walk is only 48.7 metres.
Presumably this scenario (involving a sideways jump onto the floor) is what rekstout had in mind in his first answer.