A broker won't lose money when a stock goes down in a bear market because the broker is usually nothing more than an agent acting on sellers' behalf in finding somebody else who wants to buy the shares. A broker is not required to buy from you if you want to sell shares and there is no one willing to buy.

Other traders and investors are on the opposite side of a transaction, not usually the broker. To say "everyone is selling" is usually an erroneous statement, because in order for transactions to occur there needs to be buyers and sellers transacting to create trades, even though those trades may occur at lower and lower prices. If literally everyone were to sell, there is no market in that stock (or other asset) anymore until sellers and buyers find a price they are willing to transact at.

When a stock is falling it does not mean there are no buyers. The stock market works on the economic concepts of supply and demand. If there is more demand, buyers will bid more than the current price and, as a result, the price of the stock will rise. If there is more supply, sellers are forced to ask less than the current price, causing the price of the stock to fall. 

For every transaction there must be a buyer and a seller. If the last price keeps dropping, transactions are going through which means someone sold and someone else bought at that price. The person buying was not likely the broker, though. It could be anyone, like another trader or investor who thinks the price offers an opportunity to make a profit, whether in the short-term or long-term.

That said, it is possible for a stock to have no buyers. Typically, this happens in thinly traded stocks on the pink sheets or over-the-counter bulletin board (OTCBB), not stocks on a major exchange like the New York Stock Exchange (NYSE). When there are no buyers, you can't sell your shares, and you'll be stuck with them until there is some buying interest from other investors. A buyer could pop in a few seconds, or it could take minutes or even days or weeks in the case of a very thinly traded stocks. Usually someone is willing to buy somewhere, it just may not be at the price anyone else to sell at. This happens regardless of the broker. The broker only places your order in the market place, so it can transact with other orders. The broker itself does not typically try to solicit trade in a stock, which means your decision to buy and sell are up to you, and the broker just facilitates those decisions.

If an institution acts as the principal to a certain amount of stock, a rapidly declining stock price will affect them. This is because, unlike an agent, the dealer is an owner of the stock. Examples of this include market makers

Brokers and Market Makers

As discussed above, many brokers are just trade facilitators. They don't take a position opposite to your orders.

Markets makers do take the opposite side of a trade, and may act as a buyer if you are a seller, or vice versa.

Some firms that offer brokerage service are also market makers. Market makers are there to help facilitate trade so there are buyers and sellers in stocks listed on the major exchanges. They doesn't mean they will always give a good price, they are just providing some liquidity. In some cases lots of liquidity, or in same cases very little. After a market maker has taken on a trade, they will then attempt to move those shares along (buy or sell) to another party, attempting to make a profit along the way. 

There are also times when the market maker may decide to purchase a stock from you and add the position to the firm's inventory...or sell you shares from their current inventory. The inventory is a compilation of securities out of which the firm may trade in the near term or hold for the long haul.

On most trades, brokers act as conduits. They simply post your trade in the market place so others can choose to transact with it. This means anyone may interact with your order, including other traders and investors, or market makers. There are times when a market marker will take the opposite side of your trade. They are providing liquidity, but will also try to turn a profit for providing that service...as any other trader or investor is hoping to do.

Most market makers, and other traders, will not buy something if they don't think they can make a profit on it, which means prices will as far as they have to entice buyers back in.