"Rain check" began as a ticket, and a ticket that fans had to fight for.

In the 1870s, a baseball crowd that paid to see a game stopped by rain could simply lose its money. Protoball, a baseball history site, reprints a St. Louis Globe-Democrat item of May 13, 1877. It describes the Brown Stockings' rain-check coupons, good until used for any game that season. The paper said St. Louis was the only League club that let fans see a full game or get something back. Wikipedia, citing a New Orleans paper of 1870, says tickets for rained-out games go back at least that far.

The wordorigins.org entry gives June 21, 1883 as the first record of rain checks. That day the Brown Stockings, the club now known as the Cardinals, announced them, and the club president Chris Von der Ahe called the earlier no-refund rule "a poor one." The 1877 clipping shows this was not the start. It looks more like a change in the rule for games stopped early.

Dictionaries put the word later still. Etymonline dates the noun to 1884, and Merriam-Webster's first known use is also 1884, in the sense of a ticket stub good for a later performance. Etymonline explains the pieces: rain is Old English regn, and check is used in its sense of a token or ticket.

The idea was still strange to the public in the late 1880s. A Detroit Free Press column of June 3, 1887, as Mental Floss reports it, described fans confused by the paper slips. Some refused them, probably thinking they were patent medicine ads. In 1888, three men were arrested in Philadelphia for selling rain checks below their face value, so the slips already had a resale market.

The phrase left sports quickly. The earliest non-baseball use found by wordorigins.org is from July 13, 1887, in a Baton Rouge paper crediting the Detroit Free Press. It is a joke about a hotel worker who offers a customer a rain check for a shoeshine. If rain ruined the polish, the customer could come back for another. The example is still a literal service, not yet a figure of speech.

The figurative use came afterward. Mental Floss says that by the late 1800s people used it to politely decline an obligation. By the middle of the 20th century it meant a promise of a personal favor. The OED, according to the same article, dates retail use to the 1950s, such as a store honoring a sale price on an item that has sold out.

A companion term appeared later. Etymonline records rain date, the alternate day set for an outdoor event, from 1948.