The obvious answer would be a lock, but sometimes that’s not enough. I recently heard a talk radio segment on the local AM station talking about how the reporter’s bike was stolen in about 10 minutes from the time he parked it.
One of the things I used to do was use U-locks and secure my front wheel with the rear wheel and frame. I then would take an old bicycle chain place it in an old tube, and secure my seat rail to the bike frame to prevent someone from taking it. Fortunately where I now work, I can simply place my bike in our warehouse.
What about you? Do you have any suggestions in making sure your bike is still at the racks when you get off work or walk out of the grocery store?