"bar," c.1320, from O.Fr. reille, from V.L. *regla, from L. regula "straight stick," dim. form related to regere "to straighten, guide" (see right). Used figuratively for "thinness" from 1872. Technically, railings (1471) are horizontal, palings are vertical.
"complain," 1460, from M.Fr. railler "to tease or joke" (15c.), perhaps from O.Prov. ralhar "scoff, to chat, to joke," from V.L. *ragulare "to bray" (cf. It. ragghiare "to bray"), from L.L. ragere "to roar," probably of imitative origin. See rally (2). Raillery "good-humored ridicule" is from 1653.