If coffee vendors such as Starbucks (NASDAQ:SBUX), Dunkin' Brands and Tim Hortons aren't going to raise the price for a cup of coffee for its customers, how will these companies combat the rapidly rising cost of coffee beans?

As the headline would indicate, coffee prices are up an astounding 80% to 90% year-to-date, depending on what investment asset you use to monitor coffee prices. 

The iPath Dow Jones AIG Coffee TR Sub-Index ETN (NYSEMKT:JO) is up roughly 90% in 2014, while the iPath Pure Beta Coffee ETN (NYSEMKT: CAFE) is higher by over 80% this year. 

Even more so, these ETNs are up 65% and 60%, respectively, since the beginning of February.

When input costs are skyrocketing, companies really only have two choices:

1. Pass those costs on to customers in the form of higher service or product charges, or

2. Keep customers' prices the same, and have margins suffer as a result. 

However, there is one other way these companies can have the best of both worlds: Hedging. 

You've probably heard of this term in investing. Say for instance, you have a big position in a specific stock and earnings are coming up. You could buy put options as a cheap way to benefit from a big sell-off. 

If the stock rallies, then often times the gains outpace the relatively cheap cost of the downside hedge. If the stock price falls, then the levered-option can usually cover a bulk of the losses endured in the sell-off. 

General hedging techniques are intended to be low-cost and efficient, while protecting the investor (or company in this case) from a dramatic sell-off, (or again in this case, rapidly rising input costs). 

Think of hedging simply as insurance. You pay for house insurance. Hopefully, you'll never need it. But if your house burns down tomorrow and you have insurance, then you're in luck. If not, well then, it's a different story. 

I can't speak for Dunkin' Brands and Tim Hortons' sake, but Starbucks looks to be in the clear. Because of its hedging techniques, spiking coffee prices are unlikely to hurt the company for quite a while. 

But how long is, for quite a while?

Well, to be precise, and according to Piper Jaffray, quite a while stretches all the way through the first quarter of 2015. From TheFlyOnTheWall:

"Piper Jaffray sees "virtually no risk" to Starbucks from higher coffee prices as the company is locked for the next four quarters, through Q1 of 2015."

The analyst also maintained its overweight rating, as well as its $90 price target. 

I've been a shareholder in Starbucks for the past year, and the price action seems hesitant. It's like investors want to buy it, but are reluctant to. I think it's partly because of the rapidly rising coffee prices. Potential investors are perhaps unsure how the input costs will affect Starbucks. 

If this is the reason share prices are in a lull, then it represents a fantastic buying opportunity for the mid- to long-term investor. 

On Jan. 23, the company, led by none other than CEO Howard Schultz, curbed valuation concerns when it beat earnings per share estimates and reported that margins were actually improving. 

While this wasn't the company's best earnings report, it was far better than what many investors had expected. It's also worth noting that the report was far better than what many other retail and restaurant operators reported in the fourth quarter as well. 

My point with the earnings reference is simple: Starbucks is still doing extremely well!

If you don't believe Piper Jaffray, then perhaps you'll listen to Schultz himself, who confronted the rising price of coffee in an interview with Fox Business's Maria Bartiromo: 

Among other things, Schultz argues that, "We have more than one year's worth of protection on physical inventory and contracts." 

Due to speculators, he also suggested that the price of coffee could go even higher in the coming weeks and months.

However, he insisted that Starbucks would not raise its prices, because "coffee prices at this stage will have no affect on Starbucks' ability to hit our numbers and maintain the guidance we had with the Street," he said. 

Finally, he suggested that the company's competition may not be in as good of a position as Starbucks, saying, "I suspect...we are in a much better position than they are." 

With the stock down roughly 5% year-to-date, and almost 10% off the 52-week highs of $82.50, I think shares have more room to the upside and present good value over the intermediate-term.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.