[Source: Laws of Medical Treatment on Shabbat by R'Dov Karrol]
Does the approach cited above regarding the importance of saving the life of a fellow Jew, even if it means suspending the normal rules of Shabbat, apply to saving the life of a gentile? The Gemara (Avoda Zara 26a) rules that a Jew may provide medical treatment to an idolater during the week (provided he is paid for his efforts) but not on Shabbat. The Gemara states that the gentile will understand that one may only violate Shabbat for the care of those who are required to observe it. This is also the ruling cited in the Tur and the Shulchan Aruch  as well as the Mishna Berura.
Many contemporary authorities have ruled that this principle is not applicable today, and I believe their views can be differentiated into two basic approaches. The mainstream approach responds to the claim of the Gemara that gentiles will understand if Jews are unable to treat them on Shabbat, recognizing that Shabbat violation is only justified for the sake of those who are themselves Shabbat observers. Many authorities over the last few hundred years ruled that the understanding which the Gemara takes for granted cannot be assumed in modern society. Rather, they claim, if Jews refuse to treat gentiles on Shabbat, this refusal could have disastrous ramifications, either for the doctor himself or for the Jewish community as a whole. As such, they rule that one should take whatever actions are necessary to save the life of a gentile, even if it requires violation of Shabbat laws. Within this approach, one should try to minimize the Shabbat violation required, and should only take those Shabbat violating actions that are truly necessary. Nonetheless, advocates of this approach generally assume that any violation is justified on the grounds that the deleterious consequences of nontreatment could themselves endanger the lives of Jews, and are thus to be understoodas piku’ach nefesh for Jews, which, as above, is permitted unconditionally. 
Alternatively, some authorities take a more principled approach to making this allowance in contemporary society, regardless of concern for the deleterious results of not saving gentile life. The mechanism for this approach is to limit the Gemara’s ruling to gentiles of the type that were common in the society of Talmudic times, i.e. idolaters, claiming that it is not applicable to the gentiles in our society. One source cited as a basis for this view is the Ramban, who counts helping and saving a ger toshav, a gentile who has accepted the seven Noahide laws, including violating Shabbat to save his life, as a mitzvah. If one takes the position of the Ramban (and Rav Ahron Soloveichik points out that there are others who take this view as well), the question then remains whether contemporary gentiles are defined as gerei toshav. Rav Nachum Rabinovitch, rosh yeshiva of the Hesder Yeshiva in Maaleh Adumim and author of Melumedei Milchama, a book of responsa related to army service and security matters, applies the aforementioned principle of the Ramban, and cites authorities who rule that the gentiles of today are generally defined as gerei toshav. As such, he rules that saving the life of a gentile is warranted on Shabbat. My teacher and rosh yeshiva Rav Aharon Lichtenstein of Yeshivat Har Etzion explained to me that while the views that take the first approach address the practical issue, justifying saving the life of a gentile under certain conditions, they sidestep the fundamental issue. Rav Lichtenstein said that were he to be confronted with a case of violating Shabbat to save the life of a gentile, he would act to save the life of the gentile on principle, relying on those views that allow for it in principle, not based on societal concerns alone. Rav Lichtenstein also mentioned that his rebbe and father-in-law, Rav Yosef Dov Soloveitchik, ruled that this was permissible even in cases where there would be no problem of negative results, independent of such issues. Along similar lines, Rav Ahron Soloveichik cites numerous sources regarding the status of ben noach and ger toshav, leading to the conclusion that saving the life of a gentile is warranted based on the notion that saving the life of a gentile mandates Shabbat violation on substantive grounds.
 YD 154:2.
 Sec. 330:8, and in the Be’ur Halacha (330:2, s.v. kutit). The Mishna Berura decries the doctors who neglect this halacha and violate the laws of Shabbat to save gentile lives, which he says has no basis. Notwithstanding the very strong language of the Mishna Berura, there does seem to be good basis in poskim, both before and after the Mishna Berura, for doctors who act in this way. See the next paragraphs for details.
 Clearly no poskim debate the validity of the reasoning of the above sources; the question is whether there is some change, either in the reaction of the gentiles to this perceived discrimination (as in the first approach), or in the status of the gentiles themselves (as in the second approach).
 The earliest source I found indicating this is Responsa Chatam Sofer (YD 131). Other sources include, but are not limited to, a teshuva by Rav Moshe Feinstein (Iggerot Moshe, OC 4:79), Rav Eliezer Waldenberg (Tzitz Eli’ezer, sec. 8, responsum 15, chap. 6, sec.12—it is a short paragraph from a very long teshuva on matters related to medical issues), and Rav Yitzchak Weiss (Minchat Yitzchak 1:53). A summary of this approach is found in the Piskei Teshuvot (330:2). (Note that there is a printer’s error in the citation of the teshuva from Iggerot Moshe, as it says 49 instead of 79. This is corrected above.)
 The Chatam Sofer mentions this as a possibility—if the ill-will could result in danger, then Torah-prohibited melachot are permitted. The Iggerot Moshe mentions this as a general concern, even if the individual doctor is not worried about his particular case, he raises a possible uproar resulting from this type of behavior, either on the part of the citizenry or the government. The Tzitz Eli’ezer explains that the doctor should have in mind that he is acting to save himself and Jewry in general from deleterious consequences rather than to save the gentile patient. The Minchat Yitzchak raises the possibility, mentioned by some of the aforementioned poskim as well, that the external pressures to perform the action lower it from a de-orayta to a de-rabbanan based on the principle of melacha she-einah tzericha le-gufah, a melacha performed for ulterior or abnormal purposes. Once it has been reduced to a de-rabbanan, he can permit based on the general rule of eiva, ill-will. While this understanding of the principle is itself controversial, it exemplifies the recognition that there needs to be a permit for melachot de-orayta.
 “Omitted positive mitzvot,” listed in the Rambam’ s Sefer Ha-Mitzvot at the end of the mitzvot asei, mitzvah 16.
 Responsum 43, pp. 144–146. He states his opinion regarding an innocent Christian or Muslim (as opposed to a terrorist). He also claims that taking care of enemies in accordance with international regulations is also warranted to prevent ill-will toward Jews (along the lines of the first approach), a ruling for which he cites several sources.
 I heard Rav Lichtenstein express this idea in a tish in his home on Shabbat Parshat Lech-Lecha, 5762 (October 27, 2001). I followed up with him personally in the course of preparing this document, on 9 Tammuz 5763 (July 9, 2003).
 This idea is discussed in Od Yisrael Yosef Beni Chai, in the third article, titled “Be-inyan Mevakerin Cholei Akum mipenei Darkei Shalom,” on pp. 17–28. He cites numerous sources that support his claim, as well as explaining those which do not seem to fit this model at first glance. The sources regarding ger toshav include, in addition to the Ramban cited above, Rashi (Arachin 29b), Rabbeinu Yona, Sefer Yereim, Ra’avad (Hilchot Issurei Bi’a 14:8), the Ba’er Ha-Gola (CM 266, 425), the Aruch Ha-Shulchan (YD 254:3), the Rema (OC 156) with the Gra, ibid., and Rav Eliyahu Henkin (Ha-Darom 10, Elul 5719 , pp. 5–9). The article, however, does not focus on the practical ruling. This information I heard from Rav Mosheh Lichtenstein, who told me in the name of the late Rabbi Dr. David Applebaum HYD, a very close student of Rav Soloveichik who was a practicing physician, that Rav Soloveichik told him that saving lives of gentiles is warranted even in the absence of the external concerns mentioned above. Thanks to Rav Mosheh Lichtenstein also for the reference to the article.
 Based on the Gemara Shabbat 53b, Rambam 21:20, Tur and Shulchan Aruch (328:1).
 Note the sources cited below, who deal with instances in which medicine is permitted and all maintain the assumption that there is a general problem. One example is Rav Moshe Feinstein’s view (Iggerot Moshe, OC 3:53).