If there was a right way to do it, everyone would do it, and then it wouldn't work.
Actually there is a right way, it's called "futures", and all the commodities producers (farmers, metals miners, etc)
do do it. They sacrifice a small amount of expected return in exchange for a large decrease in variance.
Unfortunately we don't have futures yet in the bitcoin world.
Also keep in mind that -- unlike real-world commodities producers -- you don't know your "cost of production" beyond the end of the current difficulty window. So you're already somewhat hedged: if the price plummets, the difficulty "ought to" drop, giving you more coins from the same equipment. Of course it doesn't always work this way...