When Kylo Ren faces off against Han Solo in Star Wars: The Force Awakens, he chooses to kill him. Why did he do that?
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 that the only way to fully embrace his training is to remove the thing he thinks is holding him back. He also wants to prove to Snoke that he really has abandoned his old life. So, once he sees Solo face to face, he's already decided to kill him. This is what he's talking about when he says he has "something he needs to do" but "needs [Solo's] help."
Supreme Leader Snoke basically insists it is his "Jedi Trial". Well, "Dark Side" trial. To ensure that there's no pull of the light side.
Originally, he discusses with Ren the Vader falling (all quotes from Alan Dean Foster novelization):
“Kylo Ren, I watched the Galactic Empire rise, and then fall. The gullible prattle on about the triumph of truth and justice, of individualism and free will. As if such things were solid and real instead of simple subjective judgments. The historians have it all wrong. It was neither poor strategy nor arrogance that brought down the Empire. You know too well what did.”
Ren nodded once. “Sentiment.”
“Yes. Such a simple thing. Such a foolish error of judgment. A momentary lapse in an otherwise exemplary life. Had Lord Vader not succumbed to emotion at the crucial moment—had the father killed the son—the Empire would have prevailed. And there would be no threat of Skywalker’s return today.” “I am immune to the light,” Ren assured him confidently. “By the grace of your training, I will not be seduced.”
“Your self-belief is commendable, Kylo Ren, but do not let it blind you. No one knows the limits of his own power until it has been tested to the utmost, as yours has not been. That day may yet come.
And then, he explicitly says what Kylo Ren's test - the one that Vader failed - will be:
“There is no need for concern.” Despite the Supreme Leader’s cautioning, Ren’s assurance remained unbounded. “Together we will destroy the Resistance—and the last Jedi.”
“Perhaps,” Snoke conceded. “It has come to our notice that the droid we seek is aboard the Millennium Falcon, once again in the hands of your father, Han Solo. Even you, master of the Knights of Ren, have never faced such a test.”
Kylo Ren believed that killing Han will strengthen him and let him achieve his goald to Be The Best (Dark Sider) He Can Be :
Ren’s eyes blazed. “No! The Supreme Leader is wise. He knows me for who I am, and who I can become.
“Your mother misses you.”
A strange sensation touched the younger man’s cheeks. Something long forgotten. Dampness. Tears.
“I’m being torn apart. I want—I want to be free of this pain.”
He's being tormented by the pull of the Light side. And he knows what Snoke told him he needs to to to remove that pull - what Vader failed to do. Kill his emotionally attached family member.
Han took another step, then stopped, waiting. A decision had to be made, and for once it was not his to make.
“I know what I have to do, but I don’t know if I have the strength to do it.” Ren moved out onto the walkway toward Han. “Will you help me?” “Yes,” Han told him. “Anything.” Halting an arm’s length from his father, Ren unclipped his lightsaber, looked down at it for a moment, and then extended it toward Han. For an instant that seemed to extend into forever, nothing happened. Smiling, Han reached for the weapon. Then, as the light from outside was fully blocked by the flow of descending, accumulating dark energy, Ren ignited the lightsaber—and the fiery red beam lanced outward to pierce Han’s chest from front to back.
“Thank you,” Ren murmured, and truly, the darkness above was mimicked by the darkness in his voice.
Kylo Ren fully expected that this would strengthen him:
Stunned by his own action, Kylo Ren fell to his knees. Following through on the act ought to have made him stronger, a part of him believed. Instead, he found himself weakened. He did not hear the roar of the enraged Wookiee above, but he did feel the sting of the shot from the bowcaster as it slammed into his side, knocking him back on the walkway.
Earlier there is a scene when Kylo is shown talking to the relic of Vader's helmet, he says he can feel a pull to the light side and asking for his grandfather's help. This does indicates he is in conflict with his choices.
Upon faceing off with Solo, Kylo sees Solo as the embodiment of everything that makes himself weak and a "warrior of light" for lack of a better term. To achieve his goals and end the pain of being torn between the two sides, as he mentions during this scene, he kills Solo to complete his commitment to the dark side.