Ralph is shot after you find out about Carl Brewer and discover that Frankie is missing.
If you're at the office before 5 pm on the day you expierence those two events, you'll see Ralph get shot.
If you don't get to the office before 5 pm, the cops will tell you Ralph was shot and will still give you his keys.
Pay attention to what he says about the man wearing a brown jacket with leather patches.