All the full- and compact-sized Glocks have the accessory rails, at least the ones made since 1997-ish. That means the Glock 17 and 19 in 9mm, the Glock 22 and 23 in .40, the Glock 31 and 32 in .357, the Glock 21 in .45, and the Glock 20 in 10mm.
The older style frame is generally referred to as the non-FGR style. Those Glocks (all models made before 1997-ish) have no finger grooves/rails. Many shooters prefer the older style frames, especially on the Compacts, since the finger grooves on the newer style compacts don't match everyone's hands.
I have a G19 with the old style "slick" frame without accessory rails, although I've owned plenty of Glocks with the rail. Never did get around to hanging anything off of it. The only thing readily available is a light, and I don't like lights on guns. (They attract only bugs and bullets, neither of which I have a use for.)
The frame of a Glock has the serial number embedded in it and counts as a firearm, just like a Bushmaster lower receiver. You could probably get one somewhere, but it'd count as a gun purchase, so you may as well pick up a used FG/R model for little more than what a new frame would cost you.