If you are new to this, the last thing you want to do is buy a car and start throwing money at it. Your best bet would be to buy a car that is race ready. You can buy a good entry level car for about $3000. You will put at least twice that much into a car that you build yourself, plus hundreds of hours work. The cost of the car is only a part of it, you need a trailer, tow vehicle, tires, entry fees, etc....
Here is a brief list of estimated costs:
1 set of wheels and tires- $1000 (you'll need at least two sets)
2 Suspension upgrade-$1800
3 Roll cage-$800
4 Other safety equipment-$400
5 Divers suit and helmet-$500-$1000
6 New brakes(rotors, drums, calipers), wheel bearings, etc... $1000+
7 Race brake pads-$250
8 Freshen the engine-$500-$2000
This list is only partial.
My recommendation is to get involved with someone who has been racing for a while, spend some time with them at the track and in the garage. I spent ten years going to races as a spectator or crew member before I purchased my first car. If your interest is in BMWs, you are more than welcome to help me out at the track. I race at Mid Ohio and the soon to be ready BeaveRun.