Quantum degenerate gases placed in optical lattices is an attractive platform to explore systems analogous to condensed matter and deepen our understanding of many-body physics by taking advantage of the tools and precision of atomic physics. First I will discuss our application of Bragg scattering as originally realized in x-ray and neutron scattering to study ultracold rubidium atoms confined in a three-dimensional optical lattice. This allowed us to study the atomic wavefunctions in the quantum regime, as well as to probe the superfluid-to-Mott insulator quantum phase transition. Next, I will describe a new scheme to create artificial magnetic fields for charge neutral ultracold atoms in optical lattices using two-photon, laser-assisted tunneling. This realizes the Harper Hamiltonian, a lattice model for charged particles in magnetic fields whose band structure is the fractal Hofstadter butterfly. This system is experimentally studied by observing the in-situ expansion of rubidium atoms in a two-dimensional optical lattice.