Pirates hit 3 homers to beat Reds 8-4