Ok- another one of those vaguely philosophical musical queries. What's the difference between playing a melody and just pumping out a load of notes?
I can't give a complete answer, but the way I think about it is a melody is not just notes, the rhythm of the notes is very important. If you are talking about impro rather than composing, a string of quavers and triplets such as you get in many bebop solos is not a good melody usually. It can be very good impro and inspiring, but I think the type of impro you get from Ornette Coleman on Shape of jazz To Come is actually more melodic. And the way lee Allen plays rock and roll solos (see the analysises on Taming the saxophone).
Ideally melody (in impro) needs to use as much of the devices you get in composition: tension, release, repetition, development, surprise, humour etc.
!!!!!! OFF Topic Alert !!!!!!
BTW your signature ("Well, if less is more, then just imagine how much more more will be" - Frasier Crane, Frasier) reminds of a couple of other things:
"If a glass of wine a day is good for you, think how much you will benefit from a couple of bottles a day"
"Moderation in all things, including moderation"