The built-in firewall for OSX is actually quite powerful. Unfortunately, the GUI they provided for it is not.
Don Picket suggested controlling ipfw (the firewall) from the Terminal. You can do this, but if you prefer a GUI, what you need is a program called BrickHouse. This provides a much more powerful interface to the firewall, which should fulfill most of your firewall needs.