Well, I compose music through a program called fruityloops where you have upwards of 15 instruments playing through the entire song. (link to website in sig if you want to download a few) I think it's easier to make music using many instruments because you can get away with making maybe 3 different beats for the same instrument that can be repeated over and over again. Usually, you'll only have a few select instruments making the main beat you'll actually pay attention to.
With a single guitar, it becomes a little more difficult I think. The best advice I can give you is listen to as many different sad songs and figure out for yourself what EXACTLY makes them sad. Is it a particular beat that lasts over 4 measures? Is it the tempo? Is it the use of dynamics that make it so perfect? (can you do dynamics with a guitar? lol)
For inspiration, I usually listen to music, watch movies, or do something else that can provide audio pleasure. Once you get something in your head you like though, go write it immediately or you will forget it. I can't even imagine how many tunes I have let slip through my brain because I haven't had time to write them down or stick them into my music program.....
I know this might sound a little weird and may even be confusing, but you might try listening to music on really low volume that you've never heard before. If played at the right volume, the brain sould only pick up about half the notes played. For some reason, at least for me, I seem to be able to create my own tunes from what I hear that sound nothing like what the music is really like. The random notes do a good job at triggering different tunes and emotions in the mind sometimes. It's best if the music has some dynamic variation (classical is a good example) as well so it's not the same level of volume all the way through. Like I said, some notes you'll hear and some you won't. This is what you want though.
You can also try playing around on your guitar for fun just to see what you can come up with. Try making a continuous tune that lasts a certain number of beats, then add chords or whatever the equivalent is for guitars.
Here's another trick I use sometimes to get a good tune. Write down some random notes that last over a few measures. Try to keep them in the same octive or at least around it. Make some last longer than others, make some notes play the same note twice or three times, etc, etc. There are many things you can do obviously, but don't go crazy and write your random notes within reason. Now all you have to do is play them. About 3/4's of the time I can get a catchy tune out of the complete randomness I create. Don't be afraid to take some notes out or add some more in. If it doesn't work out the first time, rearrange the notes and try again. If you have a music program like me, all of this can be done very quickly. If you want, you can download anvil studios and use it if you're desperate. It's for midi's but it will get the job done for what I'm talking about. (only a few MG's big I think)
Anyway, there's my opinion on what you should try doing if you're having trouble thinking up your own tune.