This situation is more common than generally recognized. Why? Because a gift annuity funded with stock, for example, is a bargain sale of the stock. The stock is sold to charity for a price equal to the initial present value of the annuity (which is called the “investment in the contract”). It is this amount that is recovered tax-free over the “life expectancy” of the donor/annuity recipient.
In a simple bargain sale, in which the charity simply pays the donor an up-front lump sum, there are two tax consequences:  The donor is deemed to make a charitable gift equal in amount to FMV – SP.  The donor realizes a capital gain if the donor’s basis in the asset (B) is less than FMV; that is, if the asset is appreciated, which is typically the case.
The realized capital gain is equal in amount to SP – B(SP/FMV). So, if the bargain sale consists of a $100,000 asset having a cost basis of $40,000 that is sold to charity for $60,000, the donor-seller realizes a gain of $60,000 – $40,000($60,000/$100,000), which is $60,000 – $24,000, or $26,000. The donor-seller is also deemed to make a charitable gift equal in amount to $100,000(FMV) – $60,000(SP), or $40,000.
Bargain sales of the sort just illustrated usually make most sense when the asset in question is an asset the charity really wants for carrying out its mission.
by Jon Tidd