I assume you've already read the Wikipedia article on radar. Here's another site I found (radartutorial.eu) which might be useful.
If you really want to implement realistic radar (or sonar), you'll probably want to use ray tracing. The basic principle is just the same as in the usual light ray tracing used for 3D rendering, so you can use any of the usual implementation techniques.
One difference is that, for distance/time-of-flight estimation, you'll want to keep track of the total length of the ray. Also, you'll typically have only one "light source", which is located at the same position as the "camera", which might allow some extra optimizations. (However, if you add the possibility of radar jamming into the mix, this is no longer always the case.)
The tricky part will be in coming up with realistic values for the radar reflectances of various surfaces, as well as modelling any relevant atmospheric effects as well as reflections from the sea surface. Also, at longer wavelengths, diffraction effects (which cannot be fully modeled by ray tracing) start to become more significant; however, I think the typical wavelengths used for modern marine radar should be short enough for these to be mostly negligible.
In any case, most of the basic code should be the same for both radar and sonar, so if you're going for a realistic implementation of one, you might as well start with that and then reuse the framework for the other.