Stocks close sharply lower, ending big 3-day rally