You choose the value for X as the last ability resolves. You can’t choose a value for X that’s greater than the number of untapped Myr you control.

1/1/2011

You can tap any untapped Myr you control as the last ability resolves, not just the Myr tokens you put onto the battlefield with the first ability. This includes Myr that haven’t been under your control since your most recent turn began.

1/1/2011

The defending player referred to by the last ability is the player attacked by Myr Battlesphere or the controller of the planeswalker attacked by Myr Battlesphere. For the purposes of this ability, that player remains the defending player even if Myr Battlesphere or that planeswalker is removed from combat before the ability resolves.

1/1/2011

As the last ability resolves, you can tap untapped Myr you control even if Myr Battlesphere is no longer on the battlefield by then. If that has happened, Myr Battlesphere won’t be able to get the +X/+0 bonus, but it will still deal X damage to the defending player.