Both taste and smell are not that well understood yet. Here is a summary of some of the chemistry and physiology.
Types of substances detected
The sense of smell detects volatile substances. As stated in porphyrin's answer, scent molecules dissolve in aqueous solution and then reach the transmembrane receptors. The sense of taste detects substances dissolved in saliva, typically after they are ingested. That way, non-volatiles like sodium chloride or sucrose can also reach the taste buds.
Channels and receptors
Substances are detected by transmembrane proteins that either act as channel or receptor. Channels selectively take up e.g. $\ce{H+}$ or ions, triggering a downstream response in the cell. Receptors bind to a ligand and change conformation, triggering a downstream response in the cell (e.g. G-protein coupled receptors). There is a hypothesis that the taste of "sour" and the taste of "salty" might involve selective ion channels.
What triggers a given taste or smell?
Tasting is a combination of what taste receptors detect with other information (notably from smell of volatiles traveling from the back of the mouth into the nose). There are only a handful of tastes. Each receptor seems to be linked to only one of them. For smell (olefaction), one substance will trigger multiple types of receptors, and one receptor will be triggered by multiple substances. The combination of receptor types firing gives rise to the perception of a certain smell. This (along with the higher number of different receptors compared to the taste buds) explains why we can distinguish more smells than tastes.