You need to remember you're playing off the other band members - have empathy & respect for their instruments & know the limits of each instrument in the band. As a guitarist & bassist, I need to stress this : DON'T be an ass and drown out all the other instruments with your guitar. There are part of the song where the lead goes tacet (silent), or only plays small riffs to support the rhythm guitar.
Also, respect the hierachy. Think of it as the layers of an onion. In the innermost layer are the drummers who provide the pulse and combines with the bassist (the next layer) to form the rhythm section. The rhythm guitarist plays above these 2 and provides the audience with the main form of the song - the chord progression. Rhythm guitars should have a different timbre from lead, preferably a "warm" sound from some kind of Vox-type of amp, so that the audience can tell them apart. A lead guitar tone should be predicated on these considerations. Dimebag Darrell used his EQ pedal for both gain & distortion during his solos.
Lead players need to understand the form of the song (tempo, progression, where the singer's lyrics are at, etc) in order to explore the possibilities open to him/her - are you going to employ chromaticisms? or mutant chords? or change key altogether? Or employ counterpoint to the main theme? in what species?
Also remember you're playing to an audience (or potential audience) - do not bore them with long drawn out solos. Be a good team player and throw the other instruments into the mix - each band member should be given an opportunity to do solos too.
Check out these bands to get what I'm saying : Guns 'n' Roses, Megadeth, Motley Crue, Mr Big, White Zombie (the drummer kicked ass in the Sexcisto album!), Sepultura (check out the badass Brazilian rhythms in Chaos A.D.), & the Buena Vista Social Club.