Currently there are 5 generations of the BMW 3-series. From old to new e21, e30, e36, e46 and the newest / current model e90.
e21 series does not have a M3 model
e30 M3 was the "original" M3 developped for homologation in the DTM end eightees. 4-cylinders 2.3l inline engine producing around 200 bhp (special models go up to 215 and even 240 with a 2.5L engine for the EVO-3 / Sportevo model)
e36 M3 was the BMW Motorsport version of the e36 M3. Great car, no racing heritage. Two versions, normal 3.0 286bhp and evo 3.2 321bhp. Bothl inline 6 cylinder engines.
e46 M3 is the current BMW Motorsport version of 3-series, still based on the now absolete e46 generation. Features a 3.2l 6-cylinder inline engine producing 343bhp. Special CSL version features some more bhp (350+)
As of today there is not yet an M3 version of the current e90 3-series generation. It is expected end 2006 or beginning 2007 I think. Features a V8-cylinder engine with about 400bhp.
Some think the e30 M3 is the ultimate sportscar/M3, especially the last evo version (evo3 / sportevo). If you find one expect to pay 40/50k. Outoff all M3's the e30 generation was the only one specifically designed for DTM homologation. I disagree. They are all great driver cars. Although with all car generations younger cars tend to be much heavier which affect handling.
See
http://www.bmwheritage.com/pages/models_e30.html
Boy, I love to talk about these cars ;-)
Mark.