At its most elemental, the Magic Number only calculates how what combination of your wins and another team's losses are needed for your team to finish ahead of the other. You can, in theory, find a Magic Number for any team in relation to another, it only gets weird when you try to find the Magic Number for a team that cannot possibly finish ahead of another team (say, like the Cubs or Astros who cannot possibly finish ahead of the Reds and thus, cannot possibly win the NL Central this year). And by weird, I mean, the answer you get is a negative number.
Anyways, the Magic Number formula is:
Magic Number = 163 - Your Team's Wins - Other Team's Losses
If you are looking at this from the perspective of the Tigers to finish ahead of the Sox, their Magic Number is 26.