Energy stocks rally 8% in July as oil surge, cheap valuations attract buyers