Order I played them: Demon's Souls, Dark Souls, Dark Souls 2
How I'd rank them: Dark Souls > Demon's Souls > Dark Souls 2
In truth I prefer more things about Demon's than Dark, but there's a critical thing that pulls Dark ahead -- character building. Demon's motivates you more into a generalist kind of character so that if you were trying to go all melee you certainly could, but things like Second Chance made it feel like you were only gimping yourself doing so. Your character always had mana as well, so there was always some elbow nudging that your character needed to use some magic. Dark Souls got rid of that with its changes to the magic system, but more than that, Dark Souls features some of my favourite weapons in the series, so I just generally have more fun using my character in that over the other two. I also preferred the change in health recovery, Estus is far more elegant than grass.
Other than that, I prefer Demon's for almost everything else. The segmentation of levels, going into the familiar hub to choose where to go to next, the immediacy of its branching, better boss fights, better atmosphere, better online functionality, I enjoyed the tendency system, I just found it better structured than either of its successors.
Dark Souls 2 is just kind of weaker than either of the other two but still good on its own. I think it just lacks a strong identity as it tries to rehash a lot of previous concepts while its own changes are a mixed bag of results. The change in the feel of character controls alone bring it to being the worst in the series, but I still appreciate it bringing back some Demon's Souls concepts that I missed.