Probably, in the case of spells with a range of Touch.
From the SRD on Touch Spells:
To use these spells, you cast the spell and then touch the subject. In the same round that you cast the spell, you may also touch (or attempt to touch) as a free action. [...] You can automatically touch one friend or use the spell on yourself, but to touch an opponent, you must succeed on an attack roll.
A handshake is a form of a touch, so go for it. The main question is whether or not a "charge" from a touch spell or the effect of discharging such a spell is visible.
Maybe in the case of ranged spells used as a Ranged Touch Attack.
Compare the description of Chill Touch:
A touch from your hand, which glows with blue energy, disrupts the life force of living creatures.
To Ray of Enfeeblement:
A coruscating ray springs from your hand.
Ranged Touch Attacks by and large work like Ray of Enfeeblement: A laser-beam or other thing not affected by armor attacks your target.
The DM could rule that a beam that originates from your hand is guaranteed to strike someone you're shaking hands with... But they could just as easily argue that the beam originates from the tip of your index finger and goes flying off into nowhere, or that the target's hand isn't a direct enough hit for the spell to take effect.
Other Ranged Touch Attack spells may have different descriptions, making them easier or harder to perform against someone you're shaking hands with.
The issue here is one of language. Ranged Touch Attacks are not "touch" from a description standpoint ("attacks like touching someone, but from an arbitrary distance"), they are "touch" from a mechanical one ("attacks that bypass armor in the same way as the touch attack mechanic").
One last note: If the person shaking your hand perceives you spellcasting (say, because you don't have the feats to hide Verbal and Somatic components), I would rule that they could drop the handshake as a reaction to your spell casting unless you had something special stopping them (Bigby's Crushing Handshake?).