This article is US specific. I apologize to my non-US readers, but in my experience US workers are much less aware of their rights and the help available to them if they are unable to work than workers in other countries.
In the US, if you are unable to work due to your or a close family member's medical condition, your job is protected by the Family Medical Leave Act, known as FMLA. FMLA also allows new parents to take time off to care for and bond with their children - this applies to birth, adoptive and foster children. FMLA provides for up to 12 weeks of time off within a 12 month period. This time can be consecutive or intermittent depending on the reason and the needs of your employer (your employer can require you to take consecutive leave even if you could work intermittently if doing so does not fit in with the flow of work.)
In order to qualify for FMLA leave, you need to have worked for your employer for at least 12 months, work for a company with at least 50 employees in your area (within 75 miles) or for a government entity, and have worked at least 1250 hours over the previous 12 months. If you do not meet these qualifications however, you are not necessarily out of luck as some states have state leave that has different requirements. For instance, to qualify for Oregon FMLA, you only need to have worked for six months and the company doesn't need to be as large. Generally, however, you cannot use state leave unless you don't qualify for federal FMLA. FMLA leave is unpaid, but you can use vacation or sick leave (and your employer may require it) in order to have an income.
If you are taking FMLA due to your own, or a family member's, illness, it must be serious enough to result in at least a 3 day period when you are incapable of normal activities such as work with either two visits to a doctor or other medical practitioner or one visit and a continuing treatment regiment. There are similar rules for chronic medical conditions, but they don't require 3 contiguous days of illness. Finally, the FMLA has changed recently to allow people whose family members are in the reserves and are called up to use it to handle issues related to that.
If you need to take FMLA leave, you should inform your supervisor as soon as possible. If it is due to something you know about in advance, you should let your supervisor know about it in advance. However, if you are out sick and don't think about the fact that you should be asking for FMLA leave, which is not completely unlikely if you are that sick, it is also your supervisors responsibility to ask you if you need it. You can still ask for the leave to qualify as FMLA when you return from sick leave, or if you are called in to be disciplined for excessive absences that are due to a qualifying chronic or acute medical condition, however you don't want things to get to that point.
FMLA is an important tool to protect your job during illness and family changes, be sure to use it when you need it.
More information on FMLA is available from the US Department of Labor. Be sure to also check into state programs if you are not eligible for federal FMLA or it does not meet your needs.