Houston will also receive a player to be named in the deal announced Tuesday.
The 27-year-old Fowler hit .263 with 18 doubles, 42 RBIs and 19 stolen bases in 119 games last season. Fowler, a switch-hitter who primarily plays center field, hit .300 in 2012.
Houston general manager Jeff Luhnow says a goal was: "to bring in an outfielder who can spark our offense."
Barnes, also 27, hit .240 with eight home runs and 41 RBIs as a rookie last season. The 23-year-old Lyles was 7-9 with one save and a 5.59 ERA in 27 games - 25 starts - in 2013. Lyles was a supplemental first-round pick by the Astros in 2008.