Almost always the victim gets the bill, but as mentioned in commentary, it depends on locality and sometimes fault. Local rules always apply.
As an example, in the US, some state authorities will assume the rescue costs except in cases of negligence of the victim. This is true even if the victim did not seek help - and this is one reason help is sometimes delayed by the victim, as they fear a large bill later on. But that can cause their problems to worsen over time, and in some cases, can cause others (eg, witnesses) to become endangered as they, themselves, engage in assist. To mitigate that, states or localities (even the feds) may contract out with certain rescue operators. But if a person seeks help either by themselves calling, or a witness calls for the victim, or even receives unsolicited help from unscrupulous emergency workers, then sometimes an emergency crew not contracted by the authority may perform the rescue, and in this case, the victim is nearly always the recipient of aid and bill.
If the victim required help as a result of negligence from another or from property neglect of the authority, then the state will assume some or all of the rescue costs. And this is not always the case right away: sometimes, the victim gets the bill, but then has to go through legal channels to reverse this.
In most cases of insurance in the US, if a person is sick, their health insurance is the primary payer. In cases of accident, then, the party at fault is always the primary payer. In cases where the other party is not identified or has no or insufficient insurance, the victim's insurance covers the costs. That is why insurance is always exchanged in accidents: it's not only about who's covered but also about which insurance company will pay.
In a rescue operation, whether it is police, national guard, or professional crews, or a mixture therein, they are part of the "injured parties" - they have incurred costs as well. They want those costs recovered as well, and fully expect that insurance companies will do that. They usually don't deal with insurance, so the bill goes directly to the victim. Many times, upon receipt of that bill, fault hasn't yet been legally established, which is why the victim usually gets the bill.
Now, if you are on private property, things can change dramatically. While the victim is still usually the bill recipient, the landowner - not being the government anymore - is also a party to a suit where cost recovery is at issue. And if the property owner is not careful about safety, they can be equally liable. The reason for disparity has to do with sovereign immunity. The federal government almost always enjoys "absolute", and occasionally "qualified", immunity, which essentially means you can't sue them. States can also enjoy a limited degree of immunity as well; and counties and municipalities receive no such protection at all, thus, the reason for having permits and proof of insurance and indemnity waivers you have to go through, even to just have a picnic. So, your search and rescue operation is, by defacto, covered by your own insurance which you presented when you reserved your time on county or municipal land, but, not when you reserved your time on state or federal land.
Interesting articles and sources:
When hikers need help, who foots the rescue bill?
Who pays for search and rescue operations?
Get into Trouble Outdoors — Who Pays for the Rescue?
Is Search and Rescue a Public Service? Not Exactly.