Phetchaburi has a couple of noteworthy restaurants, a solid night market and plenty of noodle and rice hole-in-the-wall joints scattered across town. It's also home to a sickly sweet egg custard dessert, khanom mo kaeng, which can be purchased all over the place -- careful you don't over indulge, as it's easy to.
The two downtown restaurants we really like are the one at Rabieng Rimnun and, two bridges down, and also overlooking the river, Mondee. The former is more foreigner orientated and feels like the guesthouse restaurant it is, though locals eat there regularly, while Mondee is a proper Thai restaurant and feels less likely it is about to topple over into the river.
If you've got two nights in Phetchaburi, try both, but with one night only we'd probably go with Rabieng. Prices at both are reasonable for the standard, but if you're on a tight budget, head straight to the night market.