My best work I think usually results from the lyrics being written first... but it can go either way, and I like to keep myself open in music development... I don't like to try and force myself to do things a certain way.
Sometimes a great riff can birth an entire song idea, lyrics and all... and other times, a line or two of text, with a basic idea on mood/atmosphere/direction, can develop into an epic. I also have a collection of "cool guitar ideas"... little pieces of guitar parts I record that I think are interesting ideas... and then I will often refer to this pool of ideas when trying to figure out what to do for the next section of a song, or what to do for a bridge, etc.
And exactly as Mantraschism said... sometimes I'll write music (usually pretty basic in structure), then put lyrics to it, and once I can understand the overall picture of the song, then the music gets revised and redefined under the lyrics. Usually the key will stay the same, and basic things like that, but it's hard to tell when to do some arpeggio run or some complex change until you can see how the lyrics will fit... where the lines and words end, what the emotion is, etc.
Wilted Sanity is a perfect example of this. The original version was very simple... but once I figured out where the lyrics fit and how to sing them, I was able to redefine the guitar parts to better fit the overall artistic vision. Not all the guitar stuff changed, but a lot of it did.
The next song I am working on now... the lyrics came first, then the song was developed around them, but
then... the lyrics were refined and revised a little, as new creative ideas developed once I saw how the song was coming together.
I guess the message is... do whatever works for you... and keep all avenues of creativity open.