There are many ways, depending on what API you are using. There are ways to transform a 2d line to a 3d surface mathematically, but this is usually messy to implement and also usually relatively CPU intensive (better to use the GPU).
Your best bet is probably to render the line to a texture and place that texture on the surface. You might accomplish this with multitexturing or multiple passes and blending.
There might be other ways as well, but render-to-texture is the most flexible AFAIK. Again, it also depends a lot on what API you use, since different techniques work better in different environments.
In OpenGL, the best way is probably to render to a texture. There are different ways to do it, but the easiest is to use glCopyTexImage. Search for that phrase on google and you'll find plenty of detailed tutorials to help you through. glCopyTexImage can unfortunately be rather slow, so if speed is of critical importance you might want to use frame-buffer objects instead (FBO's), but that's a lot more complicated. My advice is to use glCopyTexImage and later switch to FBO's if your application turns out to be too slow.
The mathematical way is probably going to be very messy unless your surface can be expressed as a three-dimensional function, which is probably not the case. If you have, for example, a grid of deformed quads, I'm afraid your problem is a bit tougher than I can give any solid advice on straight away (other than the render to texture solution).