You've seen it happen before: someone you know can just hear a song and play it right away. No sheet music, no teacher in their pocket to tell them where to put their fingers, just sheer talent.
Brace yourself: this skillset can be learned and taught. It's called ear training.
Being able to hear something and play it isn't some lost magical gift that some are born with and others aren't. Anyone can train their ears to analyze sounds just like they can train their eyes to analyze colors. Here is a short description of the most common method of ear training: relative pitch.
Relative pitch doesn't mean 'give or take' pitch, 'plus or minus' pitch, or approximate pitch. Someone that has good relative pitch can identify a mystery pitch given a known reference note. In other words, they can identify a note given a tonal center.
For example: play middle C, then a mystery note and identify it relative to C. Does it sound like a flat 5? Does it sound like a sharp 9? If it sounds like a major 7 then it must be B natural. That's relative pitch with interval analysis. Solfege is similar only it uses syllables.
Relative Ear Training
The simplest way to describe how to train your ears to get to this point is this: listen and get to know the sounds. For some people this might mean many hours of listening, for others this may mean a day of dedication. Here are some ways to get started:
-Find a buddy (Identify the mystery note). Have a buddy (that knows their note locations) sit down at an instrument and play a C for you, then a mystery note. You try to guess the mystery note. Repeat over and over, buy your friend lunch.
-Two instruments (Identify the mystery note). If you both have your instruments, have your buddy do the same thing as in the previous suggestion, then you find the mystery note on your instrument. Bonus points for finding the note on the first try.
-Find a buddy/Two instruments (Identify the mystery key) play a II-V-I in a mystery key, then play the note C. Identify the mystery key.
-Use recordings. There are many ear training recordings out there (Aebersold & Bruce Arnold's titles come to mind), I suggest buying one, loading them onto your mp3 player, setting it to shuffle, and just practice while you're driving to your guitar lesson in St. Paul :)
-Transcribe lots of stuff. Improve your ears by using your ears to figure things out. It's that simple.
It Takes Practice
I'm not gonna lie, it takes practice to get good at this, but the payoff is enormous: you spend less time figuring things out and more time playing, you can execute musical ideas faster, you will know whether an idea will fit before you play it, and so on. Plus, it's an envious skill!