LilyPond is a music engraving program, devoted to producing the highest-quality sheet music possible. It brings the aesthetics of traditionally engraved music to computer printouts. LilyPond is free software and part of the GNU Project. LilyPond came about when two musicians wanted to go beyond the soulless look of computer-printed sheet music. Musicians prefer reading beautiful music, so why couldn’t programmers write software to produce elegant printed parts?
When I first heard about Lilypond, it sounded almost too good to be true. When I tried it for myself, I was absolutely amazed. Not only does it print beautiful sheet music, and has easy text input, but it can export to midi files, and does a hundred other things you wouldn't expect. You don't have to worry about detailed layout, because it is all done automagically.
Don't take my word for it, try it for yourself!
If confusion arises, a great beginner's guide can be found here!