During seasons 5 and 7 and early season 8, Joey drops hints to Rachel that he is interested in her. She is not interested, and tells him so. However, in the season Six episode The One Where Ross Dates A Student, she moved in with Joey after Phoebe's apartment catches fire. As time progresses, she begins to have fun living with Joey so much that she decides to stay with him, after Phoebe's apartment is poorly rebuilt (with one bedroom) in the season seven episode The One With The Holiday Armadillo.
In the season eight episode, The One With The Stain, Rachel starts to look for an apartment for her and her unborn baby, who Ross is the father of, without consulting Joey first. When Ross finally tells him about this, he becomes worried, and decides to sacrifice his sex life in order to help Rachel look after the baby, just as Ross gets her the "good" apartment.
In The One Where Joey Dates Rachel, Joey takes Rachel out on a "date" to raise her spirits about the fact that she won't be dating for a while. Afterwards, Joey realizes that he had a great time and that he may be developing feelings for Rachel. He tries to deny these feelings because he knows that Ross and Rachel are meant to be together and Rachel carrying Ross' child makes the situation even harder.
For the next few episodes, Joey's feeling become stronger and stronger. Eventually the group slowly begins to find out, with the exception of Joey and Rachel. Joey tries to be comfortable about living with and dating Rachel when she is pregnant with Ross' baby, but in The One With The Secret Closet, he allows her to move in with Ross to make him more involved in the pregnancy.
In The One With The Birthing Video, Joey finally tells Ross that he is in love with Rachel and after some time, Ross agrees that him feeling weird should not stand in the way and that he should tell Rachel how he feels.
In The One Where Joey Tells Rachel, he confesses his love for her, but she politely and lovingly turns him down. After some tension, the situation fades, but Joey's feelings remain. While Rachel is in labor, Judy Geller shows up with a ring and tries to persuade Ross into proposing. Joey accidentally finds Ross's ring and Rachel mistakes it as a proposal from Joey, and says OK.
When Ross learns of Joey and Rachel's mistaken engagement, he becomes extremely angered. He stays upset with Joey longer than Rachel, partly because she just had his child. After a scuffle and a trip to the emergency room (after Joey forced Ross to punch him and then ducked), Joey and Rachel both assure Ross that nothing will happen and that they are just friends. However, later in the season, Rachel has a fight with Ross, moves back in with Joey and, later on, has a dream where she kisses him. After that she begins to develop feelings for him. She hints at him a few times, but he stays oblivious.
Eventually, Joey starts dating Charlie, which upsets both Rachel and Ross, who has feelings for Charlie. While in Barbados, Joey breaks up with Charlie and soon learns about Rachel's feelings for him. He turns her down, however, because of Ross. Almost immediately afterward, Joey sees Ross kissing Charlie and returns to Rachel's room and kisses her.
Joey and Rachel decide to not take their relationship any further, unless Ross is OK with it. Back in New York, they both attempt to talk to Ross about it, but something stops them each time. Eventually Ross walks in on Joey and Rachel kissing, which he is clearly not OK with, but tries to mask it. After an extremely awkward double date with Ross and Charlie, Joey talks to Ross and he tells him that he will make himself be OK with Joey and Rachel's relationship.
Joey and Rachel continue to date, but can't make it past kissing. Every time Joey would slide his hand across Rachel's thigh, she would slap it away, and Joey could not manage to get Rachel's bra open. This is most likely due to the fact that Joey has tried many times to get Rachel's bra off, and she got used to slapping it away; Rachel herself notes that she was unable to stop herself thinking about the fact that Joey was the one touching her. After trying again and injuring Joey, the two decide that they are not compatible with each other. They decide that they are too good as friends to pursue a romantic relationship and leave it at that, their relationship returning to normal.