The units package comments (in units.dtx, lines 328-329):
% The use of upright fonts for the dimension is forced in math
% mode. Units in text mode are typeset with the currently active font.
Here's a MWE that highlights this output:

\documentclass{beamer}% http://ctan.org/pkg/beamer
\usepackage{units}% http://ctan.org/pkg/units
\begin{document}
some text \unit[17]{mm} some more text
some text $\unit[17]{mm}$ some more text
\end{document}
To avoid this, you have a number of choices:
Redefine the way \unit works to insert \mathsf instead of \mathrm. You can copy the definition from the source and update it accordingly. Here's an update that just fixes the use of \mathrm:
\makeatletter
\DeclareRobustCommand*{\unit}[2][]{%
\begingroup
\def\0{#1}%
\expandafter
\endgroup
\ifx\0\@empty
\else
#1%
\ifthenelse{\boolean{B@UnitsLoose}}{~}{\,}%
\fi
\ifthenelse{\boolean{mmode}}{\mathsf{#2}}{#2}% <---- Fixed
}
\makeatletter
Place the above in your document preamble (Document > Settings... > LaTeX Preamble). For an explanation of why the macro is wrapped within a \makeatletter...\makeatother pair, see What do \makeatletter and \makeatother do?
Use etoolbox's cousin xpatch to patch \unit in a similar way to the above suggestion:
\usepackage{xpatch}% http://ctan.org/pkg/xpatch
% \xpatchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\xpatchcmd{\unit}{\mathrm}{\mathsf}{}{}
Make a global change in your document, letting all \mathrm be equivalent to \mathsf:
\let\mathrm\mathsf% \mathrm is equivalent to \mathsf
In all of the above instances, the MWE now outputs:

Nowadays it is advised to use the siunitx package instead, since it allows for more control over unit formatting (globally and locally).
\unitdefined? Or what package are you loading that provides\unit? – Werner Aug 01 '13 at 00:01\text{}(requiresamsmath). – Torbjørn T. Aug 02 '13 at 12:35