Guitars are often used along with, or instead of pianos. The guitar can be both a "comping" instrument, and a soloing instrument. In other words, its six strings can be strummed in order to play chords, or they can be plucked to play melodies.
From Jacob Teichroew, former About.com Guide