A roll cage is a specially constructed frame built in or around the cab of an automobile to protect the occupants from being injured in an accident, particularly a rollover. Roll cages extend in front of the driver, next to the A-pillar to provide as much high-speed protection as possible in a vehicle. A roll cage can also stiffen the chassis, a desirable feature in racing applications.
The first decision is whether your car needs a roll bar, cage or a partial cage. If the car will be a full-out racecar, the better option is to go for a roll cage. Here the benefits of a roll cage far outweigh the liabilities. The added chassis stiffening will allow for better and more predictable suspension. The car will be able to run more consistently and lap times will be lower. Adding harnesses and a better seat will increase driver safety and lower lap times even further.
The next considerations will be the bar material and size, which will vary depending on vehicle type and weight. The Sports Car Club of America (SCCA) specifies roll cage sizes for all their racing series, and at one time they had specs for roll bars as well, although the SCCA no longer allows roll bars alone. Since the SCCA puts on the majority of events that sports cars compete in, they're a good example of building rollover protection to a set of rules.
A major consideration for fitting a roll cage is the tubing used for building the cage. Roll cages can use smaller tubes since a cage is a stronger structure than a roll bar. For less than 1,500 pounds, tubing can be 1.375 inches x .095 (mild) or 1.375 x .080 (alloy). For 1,500 to 2,500 pounds the SCCA rules requires 1.5 x .095 (mild) or 1.375 x .095 (alloy). The over 2,500 pounds class required 1.50 x .120 (mild) or 1.50 x .095 (alloy). These measurements are for properly designed and triangulated roll cages. If planning for a more basic cage, then using stronger tubing would be appropriate. Some other sports car clubs require a 3/16-inch inspection hole be drilled in a non-stressed portion of the bar, so inspectors can verify the wall thickness of the tubing.
Factory made roll cages or systems are available for many vehicles, or industrious mechanics can make their own. The advantage to factory systems is that they are available for most popular vehicles used for racing. Don't necessarily believe it when companies claim that these are already made exactly for your car. It can still takes plenty of cutting and fitting to make a roll cage fit in your racecar.