US stocks end week with solid gains