Different frame materials have been tested and the difference in ride quality is negligible. The most important factors that determine ride quality in descending order are:
1) Tires: A wider, deeper tire will absorb more road turbulence, thus providing a more comfy ride. This is why 650b wheels/tires are so comfy.
2) Saddle: As the component most directly connected to the rider, the saddle is also a crucial factor.
3) Geometry: A properly sized bike with a relaxed riding position is more comfy.
4) Seat-Post: Less of a factor than the previous 3, but still a factor since it's connected to the saddle. Seat-post flex is actually more relevant than frame-flex, which is negligible.
That's right. A well-designed frame should have little or no flex! Considering this, in terms of comfort frame material is mostly inconsequential. Frame design is more important than the material.