Question: **Background:** CS Undergraduate applying for Fall 2022 session. (MS/PhD CS USA)

Knowing (and for obvious reasons) that it is "easier (higher chances)" to get into a masters program than a PhD Program:

**Question:** Should I apply for a PhD program at a lower ranked school than apply to a higher ranked masters program?

**Please Note:**
I love research and will go for a PhD even after the masters. My main motive is research. I ask because I can apply only to only a handful of programs and want to know which path is better.

Answer: 
Actually, in the US, applying for a doctoral degree is almost always preferable to applying for a masters. The reason is that doctoral admission almost always comes with some sort of funding and masters admission seldom does.

The advice is to apply to several institutions that cover a fairly wide range of "rankings". If you apply to only one or two programs you are unlikely to be successful because of the competition. If you want a PhD "eventually", do that now.
The only reason to apply to a MS program first would be to get some extra credits/experience with higher-level courses which may be needed for PhD programs at better schools. If you already have all that covered and want to do research, going straight for PhD makes more sense. In most departments these days they award MS just for failing your PhD quals, so there isn't much point of applying for MS except for that extra credits reason. (Or if you have money to spare and want a diploma of some sort.)