The piece of wood has probably always been loose,it is inserted into the hole in the ceiling and the light attached to it and it hangs on the wood bridging the hole,it is fiddly but it is common practice,you can put a big blob of adhesive on both ends of the wood with string looped around it with a weight hanging on it (claw hammer?)let it set then carefully screw it together,pre-drill holes for the screws.
Rich
September 2008