Rats are more active at night when the chickens are in the roost. That's the time to set traps in the run. Of course you'll need to remove the traps before the hens wake and move out to the run.
About the time the hens move up to the coop it's time to go out and remove every trace of food you can find. All the pumpkin or watermelon rinds. All the corn cobs, etc. The feed, above all. Don't leave the rats with anything but what your traps are bated with.
Red lights are helpful for observing their activity for several nights so you can see where the traps are best set. And, if possible, where they enter and leave.
Examine every square inch of your coop and run and stuff steel wool into any voids they can squeeze through. Make sure they're not burrowing under your structure anyplace. If that's where they're getting in you've got to set up a secure perimeter with a dig-proof apron. I used 12" concrete pavers AND I have my hardware cloth dug in 12" as well.
Plan a couple weeks of making all this your highest priority. And when they're gone set up a perimeter of big nasty traps on your outside perimeter. But, before you do, make sure you show any kids or visiting grandkids what kind of snap they're in for if they go near a trap so they have a very healthy respect for them and keep clear of them. My dog has never disturbed a trap. I don't know if I'm just lucky but then he doesn't go into the chicken yard unless it's with me or my husband.
I also resorted to a pellet gun. I don't know if I ever hit one but I harassed them mercilessly.
Rats are smart. If you remove their access to food and make the area hazardous they'll get it and move on to easier pickings. My compost piles are next to my chicken coop. I'm sure they discovered more secure food sources there and less risk. I'm good with them being where they don't cause any harm. But get on it and don't let them get out of hand or you're sunk.