There are a lot of possibilities and solutions for recording guitar nowadays. It all depends on the gear you already have that will determine what kind of gear you still need to record a guitar. And off course what will be the least expensive road to go.
If you want to record a guitar through an amp. You'll need a mic (dynamic or condenser) and if you're using a condenser mic you'll also need a pre-amp. Next the signal may be routed through a mixer or you can opt for going straight into your soundcard. That is if your soundcard has at least two jack inputs. (stereo- in) So that's one way to go.
If you still need to buy a mike you can also consider getting a usb mic. (There's at least one brand that has one at the moment but I don't remember which one. I think it could be Samson)
If you have nothing at all of the above gear then the cheapest and best way to record a guitar is going for the Toneport or Guitarport by Line 6. Recording is done through usb and with an additional software package that provides all kind of amp simulations.
Another even cheaper way would be, if you do own a soundcard with jack inputs, to plug the guitar straight into the soundcard. (watch your levels though) and get some freebie vst amp simulations. You can search the kvr database for these. (
www.kvraudio.com)
Hope this helps
Martin