Great question — answering as the UphillTech team:
Kylo made up his mind to do this much earlier in the movie. As soon as he discovered that Han was on the ship with Rey and Finn and the BB-8 droid, he was challenged by his master about it. We see glimpses during the movie that Kylo is still struggling with the Dark Side; he claims he feels the "pull of the Light Side" and has to fight it off. One of the biggest sources of that pull is his father, a hero and close friend of the last Jedi knight. Thus, when he finds out that Solo has returned and gotten involved in his current hunt, he knows he will have to make a decision. But Kylo is, at least in his mind, committed to the Dark Side and completing the goals that Vader once shared. He feels...
Full answer by KutuluMike: https://movies.stackexchange.com/a/45085 (CC BY-SA 3.0).
Want it for your business? UphillTech.