Sulpha drugs work by inhibiting the synthesis of folic acid in bacteria, which is essential for their growth and survival.