Is it bad for the economy of a country if forreign firms buy companies? If a forreign firm buys a company. For example a Russian firm buys a British company. Is this good or bad or neutral for the British economy?

As I see it, the profits of the company will be going abroad so this seems bad.

Alternatively, there's nothing to say the people making profits if the company is British owned aren't spending their money abroad anyway.

Would it even matter if every British company was forreign owned?

If it doesn't matter. Why would the Chinese government be buying British firms? Surely to help their economy at the expense of the British economy? Yet, the British government seems to encourage this as "investment" in British industry. So who is getting the best deal here? Seems like Britain is getting a short term boost at the cost of long term profits.
It depends upon the circumstances and isn't necessarily bad.

Suppose a foreign firm A buys a British company from its current British owner B. A is gaining the right to whatever stream of profits the company may make in future. B is gaining the price paid for the company by A.  Whether that is a good deal for B will depend upon various considerations including:


The company's likely future stream of profits if it remains in B's ownership.
The sale price, and how this compares with the discounted present value of the above stream of profits.
Whether B's best use of the sale receipt is relatively advantageous, having regard to its preferences and attitude to risk (an entrepreneur who has taken risks in building up a company may in later years wish to hold their wealth in a safer form).


So it's quite possible for the sale to be good for B. Since B is likely, through their use of the sale receipts, to contribute to the British economy by spending (creating demand) and/or saving (providing capital for other firms), it could be good for Britain.

However, these possible advantages for Britain could in some circumstances be offset by other considerations:


A's plans for the company may involve a loss of British jobs.  This could be because capital equipment will be substituted for labour, or because the company will be scaled down (perhaps the motive for buying it is to reduce competition).
The company may operate in a sector within which foreign ownership is considered an unacceptable risk for strategic rather than economic reasons.  This might be argued in respect of firms supplying military equipment or essential infrastructure.