Pursuing a master's in mathematics with eyes on a PhD: Will a D or C in graduate Analysis 2 ruin my chances? I'm a master's student currently, with a focus in pure mathematics. I would like to  apply to PhD programs this fall at other universities (as well as the program at my current university). 

Last semester I got an A in graduate Topology and graduate Analysis, but a C in graduate Algebra. I am going to retake the Algebra class this fall (required to get a B for my concentration.)

This semester has been rough. The second half of the graduate Topology sequence is going well, but I'm struggling in Analysis. Right now I'm feeling like I'll be lucky to get a D, but I'm holding out hope that if I throw myself into it I can squeeze out a C.

My undergraduate transcripts are good, but not stellar. They got me admittance and funding here. I might look into some research next year, but probably not before my applications go in.

Will I still be able to get into a PhD program? I'm not looking to go to a top school, but I was looking at some that are bit nicer - UVA, UMD, etc.
Sorry, I think I have to be blunter than the other answers.

Unless there are extenuating personal circumstances that have led to your poor performance, a C or D in one core graduate course combined with a C in another core graduate course (even if you will retake the course, presumably with a better grade) should make you seriously question your goal of getting a PhD.  Keep in mind many lower-ranked programs admit students in part so that they can have cheap labor to teach classes, while hoping rather than expecting that the student will be able to earn a PhD and get a job using their degree afterwards.  This means you could easily be admitted to some programs without necessarily having a high expectation of success.

Most PhD programs in (pure) math will require you to take comprehensive exams in analysis and in algebra.  Generally speaking, the problems on these exams will be like the most difficult problems in the final exams for your courses, although you will not be expected to solve all of them to pass.  Unless your current professors are exceptionally tough graders, or you have something else going on that indicates your performance this year is not indicative of your mathematical abilities, or you have some sudden gain of insight that significantly improves your ability to solve math problems, you will likely have great difficulty passing these exams.

Moreover, while there are quite a few exceptions, generally speaking, your ability to learn graduate level mathematics is correlated with your ability to do research.  Therefore, difficulties with your courses suggests that you are likely (but not certain) to have difficulties writing a dissertation.  (Since you might be doing a research project next year, you might have more information about this then, so I wouldn't give up yet, but keep this in mind.)

Finally, the job market in pure mathematics is quite dismal and likely to remain so for the foreseeable future.  Someone graduating with an average or mediocre dissertation will not get a postdoc.  If you are a good teacher (and you presumably have some idea by now of whether you could become one or not), you can get a teaching-oriented position, but you can (in reality, not just theory) get most community college positions and many lecturer positions with a Masters degree.  There are almost zero industry positions that you can get with a PhD in pure math that you could not have gotten with a Bachelor's degree (and an undergraduate record that can get you into graduate school).