Unlike many other animals whose sex ratios have been studied, parasitic wasps are able to determine the sex of their offspring. It is known that parasitic wasps sometimes produce different offspring sex ratios on different sized hosts. A model is constructed which includes the choice of accepting or rejecting a host as well as the choice of sex of offspring. The best reproductive strategy satisfies MacArthur's "product rule" for sex ratios and Charnov's "marginal value theorem" for optimal foraging. The model can be used to show that optimal sex ratio may vary with host density and size distribution.