I learned the meaning of this word today.
ORIGIN mid 17th cent.: from French raillerie, from railler ‘to rail’ (see rail 2 ).
affectionate raillery teasing, mockery, chaff, ragging; banter, badinage; informal leg-pulling, joshing, ribbing, kidding.
And for those interested, here is Rail(2):
verb [ intrans. ] ( rail against/at/about)
complain or protest strongly and persistently about : he railed at human fickleness.
ORIGIN late Middle English : from French railler, from Provençal ralhar ‘to jest,’ based on an alteration of Latin rugire ‘to bellow.’