This article is from the Songwriting FAQ, by Greg Skinner gds@best.com.
This question actually deserves a detailed explanation such as you
would find in a music theory or harmony book. Melody notes usually
come from the chords themselves, or from notes that belong to the
scale that the chords belong to.
For a simple example, consider the key of C major. It contains the
notes C, D, E, F, G, A, and B. Triads are built from the scale notes
by taking one as the root, and the other two a third and fifth above
it:
CEG C major GBD G major
DFA D minor ACE A minor
EGB E minor BDF B diminished
FAC F major
We can take a simple melody and add chords to it by identifying which
triads fit the notes. Here's one possibility for "Row, Row, Row Your
Boat:"
C
Row, row, row, your boat, gently down the stream,
C G C
Merrily merrily merrily merrily, life is but a dream.
Of course, you needn't be limited by triads, or major keys, for that
matter.
 
Continue to: