I always prefer to write a new guitar lick instead of use a standard one, but since anyone can throw in a bunch of notes that don't sound good, how do you write something fast, impressive (they must always be that, of course), and musical? Through experience, I've developed an approach. To do this, you'll need a song with which to play along, with a drumbeat.
For starters, it's important to write to the music. It's easy to write a lick that sounds good out of context, but then you play it over a song and it doesn't quite fit. It's too long or too short. The rhythmic groupings are off. The pitches just don't sing. All of the above. Maybe breaking it down would help.
Step 1: Identify the core pitches of your new guitar lick. While the recording plays, slowly play guitar and identify two or three notes that seem to ring out well over the chord(s). Chord tones are a good starting place, so if the chord (or key) is E Major, try Es, G#s, and Bs. Try different registers to find notes that really sing.
Step 2: Identify the note grouping/rhythm. Will it be a three or four note pattern (or six or eight by extension)? Let the recorder play while you hold down one note, striking it at the speed you want your new guitar lick to be. I generally start at my top speed and work my way down, and I sometimes alternate between two pitches. You may have to stop the recorder and slow down the pattern to figure out what the grouping is. Let's say you've realized it's a six-note grouping.
Step 3: Invent possible patterns. With the recorder off, write some six note patterns that focus mostly on those three pitches. Here are some examples I tried over one of my songs.
Step 4: Improvise. When you're ready, it's time to improvise along with the music. This time, you have an advantage. The pitches work and the grouping fits. You just have to decide on the pattern, which might take awhile but is fun (and now less frustrating and disappointing). You'll have to figure out how many times to repeat the pattern(s) and how to break it near the end.
Step 5: Add some melody at the end. Part of what makes most guitar licks work is the ending, which is often a melody that's a departure from the guitar lick itself. These little melodic snippets bring the guitar lick home. See the example below, from my song "Motif Operandi" from my upcoming CD. As I wrote the descending guitar lick (a three note pattern), I thought it was going well but seemed to dribble off into nothing, so I wasn't going to keep it. Then I improvised the last four climbing notes and the whole thing worked. Many times it seems like a guitar lick is almost cool, but not quite. You have to end it well.
Coda. Even if you don't want a stationary guitar lick, but one that moves (or a scale), the same techniques can get you started. Best of luck, and may your fingers fly true.
Randy Ellefson is an instrumental guitarist with endorsements from Alvarez Guitars, Peavey, and Morley Pedals, and a Bachelors of Music in classical guitar, Magna Cum Laude.
His most recent album, "Some Things Are Better Left Unsaid", was independently released in July 2007. Ellefson is also known for his extensive experience with tendonitis, which once took away his playing for five years.