NEW YORK (AP) — A four-day surge in the stock market came to an end on Friday as falling commodity prices brought down energy and mining companies.