When you're sitting/lying down, blood doesn't have to pump as hard. When you quickly get up, suddenly the heart has to work harder to pump the blood where it needs to go, so the brain is temporarily deprived of oxygen until it adjusts. This causes these kinds of effects.