beam from Old English:
As well as referring to a piece of wood, beam originally also meant ‘a tree’, a use that survives in the name of the hornbeam (late 16th century), a member of the birch family. Sailors understood a beam to be one of the timbers stretching from side to side of a ship, supporting the deck and holding the vessel together. From there beam came to mean a ship's greatest breadth. This is why you can call someone broad in the beam, ‘wide in the hips’. A ship that is on its beam ends is heeled over on its side, almost capsized, and so if a person is on their beam ends they are in a very bad situation.
The beam in your eye, the fault that is greater in yourself than in the person you are finding fault with, comes from the Bible. Matthew contrasts the large beam unseen in someone's own eye with the mote (‘speck’) noticed in the eye of another. When someone is way off beam they are mistaken, on the wrong track. Here they are being likened to an aircraft that has gone astray from the radio beam or signal used to guide it.
‘Beam me up, Scotty’ will forever be associated with the American television series Star Trek, as the words with which Captain Kirk asked Lieutenant Commander Scott to ‘beam’ or transport him from a planet back to the starship USS Enterprise. The exact words, however, do not occur in any of the television scripts, although it was later used in the films.