For example, a pitcher allows a baserunner, or runners, and then is replaced by a relief pitcher.
The runner, or runners, subsequently scores, or subsequently score, an earned run, or runs, before the half of the inning is over, as a result of the relief pitcher's pitching.
The earned run, or runs, is, or are, charged to the first pitcher.
A more accurate charging of a run, or runs, would result if fractional, or decimal, runs are charged, according to the number of bases allowed.
For example, the first pitcher allows a double, is replaced by a relief pitcher, who allows a double, which scores the baserunner, to a batter that half inning.
The first pitcher would be charged half, or .50, of an earned run; the relief pitcher would be charged half, or .50, of an earned run.
Each has allowed two bases, half, .50, of a run. If the above runner scored as an unearned run, only the number of bases allowed as earned would be charged, to the pitcher who allowed them.