Shazam is a free tool that recognizes songs by "listening" to them through your phone's microphone. Unfortunately, in order to use Shazam, you have to open the app and tap the button to begin the recognition process. By the time you manage to accomplish this, the song may be over.
Enter the Shazam widget, which puts a Shazam button directly on your home screen. Now, all you have to do is tap it when you hear a song you're curious about.