Randy is Marcia's boyfriend, as well as Bob's best friend and partner in crime. He probably participated in the beating of Johnny, and certainly in the violence against other Greasers. When Bob is stabbed by Johnny in the park, Randy runs off with his friends, leaving Bob's bleeding body behind.
But, Bob's death does change Randy, at least a little. Like Cherry, he tells the truth about what happened that night, and he makes several efforts to communicate with Pony. Randy's not a major character, but he does have an impact on the events and the outcome of the story. For example, suppose he had lied, and said that Ponyboy was the aggressor or something like that. If he had been believed, Pony could have been charged in Bob's murder, and he might have been separated from his family. By telling the truth, Randy shows support for Pony and helps keep Pony's life from getting any harder. He also gains some much-needed integrity.