From Wikipedia:
"In music, counter-melody (often countermelody) is a sequence of notes, perceived as a melody, written to be played simultaneously with a more prominent lead melody. Typically a counter-melody performs a subordinate role"
Simply put what this means is that countermelody is a line of melody that is played along with some sort of main phrase, and serves to emphasise it rather than overshadowing it.
Listen to this:
Jeff Wayne war of the worlds - eve of the war - YouTube
You can hear the synth plays the main melody. UNDERNEATH that you can hear strings playing a long descending run, then those strings come BACK up in pitch, and play a melody slightly different to the synth line, that complements the synth line without being the main focus of attention.
That is counter melody. To my knowledge there isn't a theoretical method to working with it apart from the same theory you would use to create the first melody. Its just layering it so that it works with itself.