Publicly traded companies are buying back their own shares at a near-record pace and they’re about the only buyers propping up the bull market, according to Bloomberg news.

Members of Standard & Poor’s 500 could repurchase up to $165 billion worth of shares this quarter and reach a 12-month total of $590 billion, just over the $589 billion record set in 2007.

Stock repurchases often occur when management feels a company’s shares are undervalued. By reducing the shares available, the company can increase earnings per share, which can lift the value of the remaining shares.

In February, Covington-based pool supplier Pool Corp. said it had authorized a $150 million share repurchase program. In September, Amedisys Inc., a Baton Rouge-based home nursing power, announced it might buy back as much as $75 million worth of stock.

Meanwhile, mutual and exchange-traded funds clients are headed the other way. Rampant selling by these clients pulled $40 billion from the stock market since January.