The rub of the green
Luck; especially in sports and pastimes played on a green surface.
Snooker commentators in the UK often refer to the 'rub of the green'. From the context of their remarks it is clear that what they mean by the phrase is 'luck', usually bad luck. I had always assumed that the green in question was the green baize cloth that covers the snooker table. When I heard the expression used in a similar context in a golf commentary it seemed just as likely that the green might have been a putting green. A little investigation has turned up the fact that, despite golf having ancient origins, the term rub wasn't first used in relation to that sport, or that of snooker, if indeed that can be called a sport, but was first used in the game of bowls. A 'rub' is any hindrance or impediment that diverts the bowl from its proper course. The term is virtually synonymous with 'let', which also remains with us in lawn tennis and in the expression 'let or hindrance'.
Some of the early 16th century references to rubs are figurative, and so we can assume that the literal term rub was in use before then. Shakespeare alludes to a rub in Richard II, 1593:
Lady: Madame, wee'le play at Bowles.
Queen: 'Twill make me thinke the World is full of Rubs, And that my fortune runnes against the Byas.
Of course, Shakespeare also referred to 'the rub', with the meaning of 'the obstacle', in one of his best-known passages - Hamlet's 'To be, or not to be' speech:
To sleep: perchance to dream: ay, there's the rub;
For in that sleep of death what dreams may come
The first appearance of 'rub of the green' in print that I've found doesn't have anything to do with games where gentlemen sank balls into holes, but from Philip Horneck's The High-German Doctor, 1716, which is a strange rambling discourse on the occult. Horneck uses the expression as the name of a character.
The first citation that I've found of the current, sporting meaning of the term does come from the world of golf. The rules of golf have been codified in Scotland since their first publication in 1744. From the 19th century these have mostly emanated from the Society of St Andrews Golfers, under the unambiguous name The Rules of Golf. In 1812, the rules included:
Whatever happens to a Ball by accident, must be reckoned a Rub of the green.
Over time, a 'rub' has altered in meaning from a physical hump, dip or some other hindrance on the green's surface to 'a stoke of good or bad fortune'.