I
This week's parsha opens with the laws of tum'at kohanim, the prohibition for a kohen to become "tamei" from a dead person. Generally speaking, there are three major categories of contact with a corpse that result in tum'ah: maga (touching), masa (carrying), and ohel (being together, sharing the same roof). Since these groups are distinct from each other, they are not able to combine to make a person tamei. For example, in order for one to become tamei by touching a corpse - maga, one would have to come in contact with a kzayit of a corpse. Likwise for one to become tamei by carrying a corpse, the minimum amount of the corpse that will render one tamei is a kzayit. If, however, Reuven touches half a kzayit, while simultaneously carrying half a kzayit, he does not become tamei. Similarly, ohel and masa cannot combine either.
What about ohel and maga? In this regard, there is a machloket; [See Mishnayot Oholot (3:1) and Gemara Chullin(125-126)]. Some maintain that ohel can combine with maga, since ohel is a type of maga, not a separate category.
It is important to stress that there are two types of ohel. One is where a person and a corpse are both together under a common roof. Another is where one extends one's body over a corpse and thus forms a roof over the corpse. (The same is true if the corpse serves as the roof over the person.)
Rava (ibid.) differentiates between these types of ohel. The first type which is known as ohel hamshacha is not part of maga, but the second which is known as ma'ahil al ha'met is. The simple explanation is that these two operate in totally different ways. Ohel hamshachah is a new type of tum'ah: being together with the corpse makes Reuven tamei. However, when Reuven is ma'ahil on the met, the tum'ah of the corpse spreads upwards and thus touches Reuven. Although Reuven does not actually touch the met, he does touch the tum'ah which has shot up from the dead body. Thus, this type of tum'ah is actually a form of maga and can therefore combine with it.
II
This discussion may have significant relevance for Kohanim attending medical school. The Rema (Y.D. 372) rules that a gentile corpse does not make one tamei via ohel (in accordance with the opinion of Rebbe Shimon in the Gemara), but maintains that it is, nonetheless, proper to act stringently.
The reasoning of Rebbe Shimon is that in Parshat Chukat, the tum'ah of ohel is introduced with the term "adam", a term used exclusively for Jews. For this reason, many hold [See Bet Yosef and Schach ibid.] that a dead gentile makes one tamei through maga and masa, for only by ohel is "adam" mentioned. For this reason, even if a kohen were to ignore the Rema's stringency about ohel, he would nonetheless be forbidden to physically handle a gentile corpse.
Where does ma'ahil al hamet fit in? According to Rava that this is part of maga, then just as maga with a gentile corpse is absolutely forbidden, so should this type of ohel be prohibited even without the Rema's stringency. In fact, the R'shash (Psachim 9a, Niddah 57a) suggests so, according to some Rishonim. Nonetheless, the halachah is clearly not this way. Even ma'ahil al hamet is permitted by a gentile corpse according to the letter of the law; it is prohibited only according to the Rema's stringency. (The reason is that it is not classical maga, but rather an extension of normal maga; this extension of maga also being introduced by the term "adam". See Rashi ibid. In addition, see Rambam end of Hilchot Tum'at Met, Chapter 4.)
III
Why does the Rema rule that it is proper for a kohen to avoid ohel with a dead gentile? The simple understanding is in order to satisfy those who disagree with Rebbe Shimon, and hold that a gentile corpse does have the quality of tum'at ohel.
However, some Acharonim maintain that this is not the correct understanding of the Rema. Rather, the stringency is the reasoning mentioned in Section II, namely, ma'ahil is a type of maga, like Rava. Thus, it may be prohibited even according to Rebbe Shimon. If so, the Rema's stringency applies only to the kohen leaning over the dead gentile, but not to his being in the same room. (See Petach Ha'ohel Klal 7 from HG"R Yehoshua of Kutna. See ibid. Klal 2, a rumor from the Netivot). Others, though, disagree.
Shabbat Shalom!