What's a good way to learn opening theory? I'm a hobbyist chess player and usually play online. While I've seen thousands of great chess games and win a fair number of games online, the one thing that I have struggle with is studying openings. Simply put, there are just so many of them and each of them has so many variations. And to add to that, every out-of-book move my opponent makes throws me off and I don't know how to continue, so it turns out to be some hybrid/weird opening (or perhaps its a real opening with a name that I just don't know about)

I guess my question would be:


What's a good way to learn some of the common/easy openings? Is it
just memorize or understanding the principles for instance, what
that particular opening is looking to achieve?
How do I identify which of the variations to look at for a
particular opening, there are often so many?
What's a good strategy to deal with my opponent suddenly going out
of book or playing a novelty in an opening that I've memorized?
In reading your question, I can't help but think you aren't asking your real question, which I read as, "When I'm out of my book I get abused.  How do I stop this from happening?"

I'm assuming that, like me, you're a USCF player rated under 1800.  I offer the following advice:


Learn two openings with White and two with Black.  Choose white openings begin with e4 or d4.  Avoid long lines where your opponent may be more booked-up.  At the amateur level, most openings and variations are playable.  Your openings with the Black pieces should be sound but off the beaten path a little.  Study games online, buy books, whatever.  Hour for hour, books are cheaper than movies. Go for it.
Find an instructor who's rated 400 or more points above you.  Ask this person to help you with your game, especially when you're out of your book.  They'll help you with applying guiding principles.  Chess principles are simple until it's time to apply them. Your instructor can help.
Don't memorize without understanding.  It is critical to understand why book moves are standard.
Don't be afraid to lose.  "I'm out of my book, I better play it safe!" is poison.