As for recording in general, that's a huge subject. The old school way of recording guitar is it to mix the guitar amp in a sound treated room, usually using something like a Shure SM57 or SM57 Beta. This technique is generally used with tube amps, or amps that display certain tonal and overdrive qualities when played a loud volumes, or "over-driven". Obviously this technique requires a studio and a bunch of gear, and an engineer that knows what they are doing, though there a million examples of famous tracks being recording in weird places, like someone's bathroom or something, but the norm is in a studio in a very controlled environment.
One of the by-products of the digital revolution is the creation of "amp simulation". Companies like Line 6 have made electronic devices that they claim accurately simulate a miked amp. So now the need for mics and sound proof studios to get your guitar recorded with "mega tone" is negated. Amp simulation has evolved to software form, meaning you can buy something like Guitar Port where you plug directly into your computer and the software does the simulation. Digital amp simulation quality varies. Some sound really good, others sound pretty artificial, but its certainly something you'll probably want to look into.
As a side note, check out a post on the Listening forum where the guitar was recorded the old fashion way, with a high gain amp & mic:
http://soundclick.com/share.cfm?id=8931064