Gains for financial and health care companies helped temper the market’s losses. Berkshire Hathaway rose 0.9% and Merck & Co.