Pulling a song out of the air -- here are my thoughts, for what ever that may be worth. Understand this gets a first draft. After the first draft you will need to flesh out the song into it's final stage.
I start with the story to be told, others start with the melody or tune. Does not matter which one you start with important thing is you connect all the dots before you finish.
I get the story into verse form. A four line verse seems to be what I use. Four or five rhyme or not, it's your song. I next pick a key, the one you sing in is preferred. For the first draft pick your favorite chord progression, at this point you are looking for the journey the story will take from rest, tension, climax, resolution and the return to rest, i.e. I IV V I or I vi ii V I, what ever you are comfortable with. The lyrics on the first two lines of your verse are over one complete progression. This same progression is repeated in the next two lines. At this point it's a first draft.
You are pulling a song out of the air -- I need a structure to keep me on track. If you are not a detailed person no need to read farther. You mentioned Blues. The 12 bar progression using I7-IV7-V7-I7 call and response lyric flow is a tried and true structure (LOL - Woke up this morning). For first drafts rely upon those that have gone before us. Hard Rock - dirt simple I IV V and Jazz - ii V7-I. Good luck on jazz suggest you work from the standards leave the songwriting for later.
At this point work on the lyric flow with the chord progressions, you may have to add a word, move a chord to get the two flowing with each other. Verbalize your lyrics while playing the chord progression, yep, your bass is not the ideal instrument to use in writing a song. No point in re-inventing the wheel. You've got your first verse's structure in place, use that as a guideline for two more verses, and at first use the same thing for the chorus. Each verse starts a new thought (I chord) moves to tension as the story unfolds (IV Chord) the story builds to a climax (V7) and then this thought is brought to an end back with the tonic chord (I chord).
Time for another thought to be brought forward (second verse). The chorus is the hook, the part of the song you want them to remember and be humming or whistling tomorrow.
OK you have the story into a verse structure. The story moves between three verses and one chorus. You have decided on a chord progression and the two flow with each other. Time for the melody.
As I started with the story I have the lyrics. I'm now going to follow a couple of rules of thumb. 1) The melody line and the chords used with that melody line should share some of the same notes. If they do the melody line will harmonize with the chords, and that is your first goal. Ever wonder why we have to change chords? The melody line has moved on to notes not found in the old chord. To harmonize it is necessary to find a new chord that has some of the new melody notes in IT'S makeup. 2) At this point I work on the individual notes for each lyric word. Each lyric word gets at least one note. Which note? Good question! What chord is harmonizing this part of the song - this phrase? Makes since to use the chord's tones as your melody notes. Using just chord tones is a little limiting so I rely upon the pentatonic notes over this part of the melody. That gives me three chord tones and two good passing notes
to use as a melodic phrase.
First word of the song, first chord of the song. Song is in C, and the first chord is a C which has these notes; C, E and G. Which one of those three notes sound good over the first word? Say the first word is "Some" verbalize the word while playing the C note, how does it sound? Try it over the E and G note. Which do you like best? I like E, up to you it's your song.
Work in phrases taking into account the chords and the pentatonic notes available. Which sound good and flows with the lyrics. Why phrases? We talk in phrases we like to hear phrases. A string of notes turns into noise very quickly. Your melody needs breathing spaces, couple of notes close together then a leap. Interesting part of all this is what do you do after the leap. I've attached a paper on melody writing. Writing those phrases on a keyboard is a lot easier than on your bass. An inexpensive one is all you need.
You asked about soloing. Soloing the established tune or improvising - composing on the fly - which way? Playing the tune, I recommend you learn how to play from standard notation - read what the songwriter thought this song should sound like and play that on your instrument. Improvising, that's another story and I have rambled too long. Here is a good starting place.
http://books.google.com/books?id=Hty...age&q=&f=false