there is a dude here called SimenE i think which actually able to improvise with counterpoint, as much as jazz musician can improvise harmony and melody, he told me that by learning to play alot of counterpoint pieces and figuring out for yourself what the composer did to make it work, makes you a better counterpoint writer-or improviser.
there are certain rules for counter point derived from the classical harmony, such as forbidden parallel fifth's and the restriction of jumps(i think?) probably more stuff, but it heavily relies on the chord notes and the harmonic pulse-which is to play those chord notes-1,3,5 or 7 either on the 1 or the 3 of the beat(for 4/4 bar), the rest can be chromatic. of course there are many exceptions where composers actually break those rules and still sound "beautiful and good" as you've said, but i think its a good starting point than anything else i know.
if you are able to follow those rules and still remain musical and "free" i think you'll be able to sound counter-point'ed alot.
however, i'm jazz trained so i'm sure i babbled here alot so my friends here can correct me :P