The perfect Solo

The D N A of a song is what makes it different from other songs that may have qualities that are the same. A good example of players who really understand this is found when you start to listen to blues players with a more critical ear. Many blues progressions have the same chord sequences and grove. The difference may be the actual phrasing of the singers melody. In cases like this the seasoned player will zone in out capturing the singers unique phrasing style. By approaching blues soloing in this way you free your self from falling into the trap of repeating the same old licks from one blues song to the next.
 
The perfect solo can be structured from the over all groove of the song.  When a solo has adapted the grove or basic rhythm of the song it can be all over the place melodically.  Eddie was and still is great at doing that with the use of many of his bag of tricks. Many of Eddies solos used harmonics, whammy bar, and slides but he was always in the groove.  
 
Both approaches will open avenues of creative ideas that produce the perfect solo. The right solo may have elements of both some time taking place at the same time or in various sections of the solo. A good example is the solo in Smoke on the Water, that has a very melodic and rhythmic feel at the same time.   
 
Some times the perfect solo is a stand alone section of the song that has elements of the melody, and the grove but played over different chords than any of the chords heard before the solo. The song jump comes to mind, here the solo is played with a complete different feel and a modulation is used to add more interest as well.
 
One thing a perfect solo does is it adds to the the songs musical value as a standalone  work of art. When a soloist has captured the feel or melody or both of the song they have done so by illustrating their understanding of the songs musical statement it is making. This is where the song falls into classifications as to what style it is.  The perfect solo is not going to have heavy metal rock licks over a jazz grove and vice versa.
 
So in summary of all that has been said, great solo players are not guys that cram a bunch of canned licks together and call it a solo. They are players who have developed the ability to use the song as their source of improvisation to add to the song not take away from it. A player that understands the unique D N A of the song they are soloing over and uses it always leaves the listener with the sense the song would be missing something with out it.