I assume you are letting them out in a run during the day. They probably don't know where home is yet. If you leave them locked up in the coop for a few days so they get in the habit of sleeping in the coop, they will go in by themselves at night. That way, the coop becomes a nice, safe, comfortable, familiar home. Or you can put them in by hand at night for a few nights and they will get the same message. Either way works. As others have mentioned, having a dim light on may help too. They can't see in the dark. If the coop is dark while it is still fairly light outside, they may not start to go into the coop until it is pretty dark in there and they cannot see, so they just huddle up outside. It does not take much light but they may need a little.
You did not mention how old they are. I'm guessing they are still fairly young and you recently put them in the coop from a brooder. Even if you have roosts, they may continue to sleep on the floor in a pile for a while. They may play on the roosts during the day, but mine usually do not start roosting at night until they are 11 or 12 weeks old. They prefer that comfortable pile on the floor.