STEP 1: HAVE A GOOD KNOWLEDGE OF THE PART YOU ARE WRITING ON:
Before you start writing any note, it is important to get a good knowledge of the rhythm section backing track: the chords, the rhythm, etc.
If there is a rhythm guitar playing at this time, learn what it is playing. Or else, learn at least the bars division.
i.e: The solo is 16 bars with a 4 bars pattern repeated 4 times using the chords Am/ Dm / F / E7
STEP 2: KNOW WHICH SCALE TO USE DURING YOUR SOLO
Although scale is a totally different subject that won’t be explained here, the second step to write a solo is to know on which scale it will be written on.
The scale to use is often described by the first chord of the pattern. In the previous example, the A minor scale should be used on the three first bars, and the A harmonic minor scale can be used over the E7 chord.
STEP 3: IMPROVISE PHRASES OVER THE PATTERN
This is where it usually gets more tricky: an efficient guitar solo will usually be divided in clear phrases. A guitarist will need to write 4 ”clearly punctuated sentances” over the 4X4 bars pattern.
Those 4 phrases need to breathe and we need to hear their division clearly when we hear the solo.
It is also important that each phrase as its own personality i.e:
-One phrase can be more melodic
-One phrase can be arpeggios over the chords
-One phrase can be shredding over the scale
Variation is the key for writing interesting solos, if the same technique is used all the time, your solo will soon get boring.
Also, it is a good to play on different parts of the guitar. Make your solo wide, use the most you can of the 4 octaves! And don’t start / end every phrase on the same note.
So before writing anything on paper, it is good to improvise over the solo to instinctively divide the phrases, and start writing the main idea of each phrase.
STEP 4: VERIFYING THE NOTES
Once you have improvised phrases over the background track many times, you’ll start to have solid phrases for all of your patterns. At this point, a good idea is to write your solo on paper: verify the rhythms are clear and the notes are strong and appropriate with the underlying chord.
You can also use tablature software to have a good overview of how your solo sound and if the notes are good. You can also record your solo and listen by yourself if the feeling is good.
I have used this writing technique over the past years and it has proven to be successful. Write as much as you can and good results will come from experience!