rikuRiku is the eldest of the trio, and has been best friends with Sora and Kairi both since childhood. Out of the group, Riku was the quiet, thoughtful one, the one that most dreamed of seeing other worlds, partly in thanks to a boy that left once and Kairi's arrival, which confirmed their existence. Eventually, Riku manages to convince Sora and Kairi to join him on his adventure. Riku puts the wellbeing of others before himself and is wholly dedicated to his friends and will use any means to protect them - again, even if it means giving up on himself. To an extent, he does not think he deserves the opportunities now given to him, even if he has long since paid back any debts he felt he owed. He feels guilt over succumbing to the darkness and that he will never be able to gain redemption, even if Sora and Kairi have already given it to him a long time ago.
Whilst Riku spends much of the first few games traversing in the darkness and, when returning to the side of good, doing much behind the scenes, he was always doing whatever it was with his best friends in mind. After defeating Xemnas, Riku and Sora talk to one another and finally come to terms with their rivalry, and their friendship is perhaps truly mended. Sometime after, he and Sora are invited to the Mysterious Tower by Yen Sid to take a Mark of Mastery exam. Riku does not expect to pass this and even questions being there. However, when things go awry as Xehanort intervenes, it's thanks to Riku's efforts that Sora is saved and does not become a vessel. As a result, Riku is the one who becomes a Master, much to his surprise.
Yen Sid then sends Riku back to the islands with a mission, to return with their Seventh light – his other best friend, Kairi.
Sora's completely helpless without us.
Whilst Sora is the most upbeat and oblivious of the group and thus has striking dynamics with the both of them, Kairi and Riku's relationship is something I find to be more subtle. Riku feels protective of both of his friends, and is often thoughtful and insightful. Sora might dismiss this, but Kairi wouldn't. They both can tease Sora and are relaxed and content enough with each other's company to not fill it with idle chatter. In some ways they are very similar, and in some ways Kairi is everything Riku isn't. For example, Kairi isn't distrusting in the way Riku is shown to be in his darker moments.
Kairi means enough to Riku that he spends most of the first game searching for her, as he spends much of the second protecting Sora from the sidelines, and then, later, protecting Kairi. Back in the first game, Riku becomes fixated on this singular goal of finding Kairi and is distressed when she cannot wake due to the loss of her heart, and unnerved when he finds out Sora can wake her. It bothers him, evidently. Wanting to save Kairi lulls him deeper into the darkness, compels him to control the darkness, and his original reason and noble plight becomes corrupted in the process. Any means necessary was his method. Eventually, when Riku comes to his senses after 'Ansem' takes over his body, his first action is still to stop him. He won't use him to hurt her. He tells Kairi to run - which, after a few seconds of deliberating, because he is one of her best friends, and he's in danger - she does. Despite everything that's happened, she trusts and is still trusting in him. She doesn't blame him for anything that has happened. When he is locked in darkness, Riku still thinks of Kairi, compelling Sora to take care of her.
Riku is aware of Sora's feelings for Kairi, as it's something he likes to tease him about (perhaps not so aware of his own, mind). He is also equally as much aware of Kairi's feelings for Sora, so he gracefully - after much heartache, destruction, and a whole game, really - backs out and is content with their happiness rather than his own. Like everything else, he puts them first.
What's perhaps most important about Kairi and Riku's relationship is that a lot of it goes unspoken. They have very little shared dialogue, but this doesn't say they don't interact or aren't important to the other; just the opposite. It's the shared looks, the company, the unbreakable trust between them. Riku is the first to realise Kairi needs to defend herself, after all, and takes up arms with her, rather than solely protecting her. They wordlessly take out the Heartless, Riku checking on her over his shoulder, and Kairi watching his back. Just because they don't speak doesn't mean they aren't strongly linked to each other; It's not what they say, it's what they do. Kairi has forgiven him and as best friends they will protect each other through thick and thin, always.