Abstract: We develop a duality theory for localizations in the context of ring spectra in algebraic topology. We apply this to prove a theorem in the modular representation theory of finite groups. Let be a finite group and be an algebraically closed field of characteristic . If is a homogeneous nonmaximal prime ideal in , then there is an idempotent module which picks out the layer of the stable module category corresponding to , and which was used by Benson, Carlson and Rickard [D.J. Benson, J.F. Carlson, J. Rickard, Thick subcategories of the stable module category, Fund. Math. 153 (1997) 59–80] in their development of varieties for infinitely generated -modules. Our main theorem states that the Tate cohomology is a shift of the injective hull of as a graded -module. Since can be constructed using a version of the stable Koszul complex, this can be viewed as a statement of localized Gorenstein duality in modular representation theory. Various consequences of this theorem are given, including the statement that the stable endomorphism ring of the module is the -completion of cohomology , and the statement that is a pure injective -module. In the course of proving the theorem, we further develop the framework introduced by Dwyer, Greenlees and Iyengar [W.G. Dwyer, J.P.C. Greenlees, S. Iyengar, Duality in algebra and topology, Adv. Math. 200 (2006) 357–402] for translating between the unbounded derived categories and . We also construct a functor to the full stable module category, which extends the usual functor and which preserves Tate cohomology. The main theorem is formulated and proved in , and then translated to and finally to . The main theorem in can be viewed as stating that a version of Gorenstein duality holds after localizing at a prime ideal in . This version of the theorem holds more generally for a compact Lie group satisfying a mild orientation condition. This duality lies behind the local cohomology spectral sequence of Greenlees and Lyubeznik for localizations of . In a companion paper [D.J. Benson, Idempotent -modules with injective cohomology, J. Pure Appl. Algebra 212 (7) (2008) 1744–1746], a more recent and shorter proof of the main theorem is given. The more recent proof seems less natural, and does not say anything about localization of the Gorenstein condition for compact Lie groups. [Copyright &y& Elsevier]