In casino blackjack, the odds fluctuate from round to round as cards are dealt from a randomly shuffled pack. A player who ‘counts cards’ can estimate the odds on the next round and so can vary his bet size accordingly: better-than-average odds warrant a larger bet. The optimal relationship of bet to count is derived here under the criterion of maximum expected increase in capital per round subject to a specified risk of ruin. The optimization analysis is complicated by the need to impose lower and possibly upper bounds on the bet size. A family of optimal betting schemes is found, depending on the risk selected and other parameters; among this family is the one found by Harris, Janecek and Yamashita using a different optimization criterion. Representative computational results are displayed for a typical set of blackjack conditions. Some commentary is given on the choice of a bet scheme from the optimal family, depending on the player’s style and objectives. Remarks are also made about Kelly betting, in the context of risk.