What is the best way to repair a cracked bathtub?
Most bathtubs that aren't cast iron or steel are acrylic plastic.

If the crack is right through the tub and water is leaking though, you should replace the tub.  If it's an emergency and you need a short-term repair, I'd use a two-part epoxy.  Choose a thin epoxy (2:1 ratio) from the selection at the home center and use a putty knife to try to force it into the crack.  Let it cure for 24 hours.  This will be at best a short term solution because if tub cracked it must be because it flexed in that spot - it will flex again and the brittle epoxy repair will crack again quickly.

If the crack is a surface scratch, it can be repaired with a repair kit such as offered by http://www.surface-repair.com/.  The problem is color matching: your tub will have changed color over time and it will be difficult or impossible to get a good match.

Another approach is using fine sandpaper.  You can get very fine wet-and-dry sandpaper at an auto parts store like Napa.  Get 320, 600, 1200 and 2000 grit.  Apply some elbow grease to the scratch with the 320.  Try to keep the scratches localized and in one direction.  Use the 320 until the scratch is gone.  Then move to the 600 and keep it up until the scratches from the 320 are gone.  By the time you're done 1200 you may be satisfied, but if not you should be able to get a fairly glossy finish with the 2000.