We present a model of the survival-maximizing foraging behavior of an animal searching in patches for hidden prey with a clumped distribution. We assume the forager to be Bayesian: it updates its statistical estimate of prey number in the current patch while foraging. When it arrives at the patch, it has an expectation of the patch's quality, which equals the average patch quality in the environment. While foraging, the forager uses its information about the time spent searching in the patch and how many prey has been caught during this time. It can estimate both the instantaneous intake rate and the potential intake rate during the rest of the patch visit. When prey distribution is clumped, potential intake rate may increase with time spent in the patch if prey is caught in the near future. Being optimal, a Bayesian forager should therefore base its patch-leaving decision on the estimated potential patch value, not on the instantaneous patch value. When patch value is measured in survival rate and mortality may occur either as starvation or predation, the patch should be abandoned when the forager estimates that its potential survival rate during the rest of the patch visit equals the long term survival rate in the environment. This means that the instantaneous intake rate, when the patch is left, is not constant but is an increasing function of searching time in the patch. Therefore, the giving-up densities of prey in the patches will also be higher the longer the search times. The giving-up densities are therefore expected to be an increasing, but humped, function of initial prey densities. These are properties of Bayesian foraging behavior not included in previous empirical studies and model tests.