Start listening to a wide variety of music and start by learning other things. After getting reasonably good at the guitar, I struggle with writing, but when it comes, it comes really well. Just be patient.
I just mess around and come up with licks/riffs. I'll try to play scales in a different way, invert chords, try some new voice leadings, etc. Usually I'll come up with a thing or two and build a song around that. If I can put a melody or lyric to it right away, then all the better!
I am a drummer but, I love the git-fiddle. It seems that I ALWAYS have one in my hands. When I'm watching TV I'm pickin'. When I'm on the phone, I'm pickin'. When I'm doin' the horizontal bop... well I guess I'm not pickin' then...
I guess what I'm trying to say is that if you wanna be creative on the guitar you gotta spend some time with it. It takes practice just like any other instrument.