Senator Edward M. Kennedy, battling cancer, made an unexpected return to the Senate to vote on a Medicare bill.