If K had the ball in his hands with neither foot on the ground, and his next foot landed out of bounds, then he did not possess the ball in the field of play. The kick would be considered out of bounds, R's ball at the K48 (OOB spot + 5... or any of the other myriad options).
If he had possession of the ball in his hands with a foot down in bounds, and the next step was out of bounds, then it's K's ball at the R47.
Imagine it was a forward pass at the sideline and how you would rule possession in that scenario.