(Updates share price and adds more details from results)

Netflix Inc.'s (NFLX) second-quarter earnings climbed 22% on increased subscriber growth and higher margins.

Netflix shares traded up 3% to $47.99 after-hours, as the online movie rental company's earnings topped most expectations, and it raised its annual guidance. However, the shares gave back most of their gains later on. The company's stock is up nearly 60% year-to-date.

The company has benefited as consumers opt for in-home movie nights over expensive evenings on the town at a theater. But it faces competition from standalone DVD kiosks, which Netflix says has yet to impact its business, and its online rental business is getting heat from companies like Amazon.com Inc. (AMZN), Apple Inc. (AAPL) and Hulu - a joint venture from General Electric Co. (GE) unit NBC Universal, Walt Disney Co. (DIS) and News Corp. (NWS).

But Netflix's results don't yet reflect those headwinds, although it did see a slight increase in customer churn, and slightly missed quarterly revenue expectations.

It posted earnings of $32.4 million, or 54 cents a share, compared with $26.6 million, or 42 cents a share, a year earlier.

Revenue increased 21% to $408.5 million.

The company in April forecast earnings of 44 cents to 53 cents and revenue between $403 million and $409 million, in line with analysts' estimates at the time. Analysts polled by Thomson Reuters most recently expected per-share earnings of 50 cents on revenue of $410 million.

Subscriber-acquisition costs, a closely watched metric for Netflix investors, fell 17% to $23.88 per subscriber, which is better than most analysts expected. The company said in April it expected those costs to remain below $28 for the rest of 2009.

The company's churn rate - a measure of customer cancellations - proved to be a blemish. It increased to 4.5% from 4.2%; analysts were expecting churn to stay flat.

Netflix watchers have raised concerns about customer defections to DVD kiosks like those offered by Coinstar Inc.'s (CSTR) Redbox Automated Retail LLC. Netflix Chief Executive Reed Hastings said in April he expects the kiosks to be the company's biggest competitor by the end of the year. Yet the company's strategy has been largely to ignore the threat.

Gross margin rose to 34.1% from 31.8%.

Netflix ended the most recent period with 10.6 million subscribers, up 26% from a year earlier and at the high end of its April forecast of 10.4 million to 10.6 million. Quarterly growth was 3%.

Looking ahead, Netflix predicted third-quarter earnings of 39 cents to 47 cents a share on revenue of $416 million to $422 million. Analysts estimated earnings of 45 cents on revenue of $418 million.

The company boosted its full-year target, saying it expects earnings of $1.65 to $1.82 a share on revenue of $1.65 billion to $1.67 billion. Its April forecast was for earnings of $1.56 to $1.72 a share on revenue of $1.63 billion to $1.67 billion. Wall Street forecast per-share earnings of $1.72 on $1.66 billion in revenue for the year.

Netflix also now expects to end the year with 11.6 million to 12 million subscribers, up from its previous forecast of 11.2 million to 11.8 million.

 
   -By Melissa Korn and Kathy Shwiff, Dow Jones Newswires; (212) 416-2357; kathy.shwiff@dowjones.com 

(Ben Charny contributed to this report.)